Welcome, Guest. Please Login or Register.
May 31, 2025, 03:12:20 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  anyone know how i can accomplish this? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: anyone know how i can accomplish this?  (Read 278 times)
bighired
Noobie
*
Posts: 26


okay... breathe deeply!

WWW
anyone know how i can accomplish this?
« on: September 05, 2002, 12:05:22 PM »
Reply with quote

i want to replace the comments feature on my main page of my regular site with a link to a thread in the forum. basically, i'm wondering if there is  a way to have it run independently. therefore, i just add some code to the post which starts a new thread in a certain board for that post. i don't know. something like that, but any ideas on yabbse's (1.41) abilities would be appreciated, as well as any ideas.
Logged

i thought i hated mathematics and numbers. what the hell happened!
Roundboy
Jr. Member
**
Posts: 72


I pretend to know everything.

ercdvs@hotmail.com WWW
Re:anyone know how i can accomplish this?
« Reply #1 on: September 05, 2002, 02:09:55 PM »
Reply with quote

I would say that when you create your news post... you also have it run the floowing SQL querys

(NOT REAL CODE)

INSERT into TOPICS VALUES (BLAH BLAH)

 -- you will need to know what member number is setting this, etc.  Look at the TOPICS table for what you need to grab.

THEN.. you need to get whatever ID_TOPIC was created (mysql_insert_id() will do this)

that will create only the topic, but no first message.. you can then do an insert into the MESSAGES table with the proper numbers and text, to make the 'first' post.

then its just a matter of making a url point to :

http://www.sitename.com/forum/index.php?board=INSERT BOARD ID;action=display;threadid=INSERT THREAD ID

this is something i was thinking about doing..  I think I may just sit down and code this....  I'll give you specifics if i do.
Logged

I have trouble seperating games from reality...
... I just used a shotgun on my mother, and she's not respawning.
bighired
Noobie
*
Posts: 26


okay... breathe deeply!

WWW
Re:anyone know how i can accomplish this?
« Reply #2 on: September 05, 2002, 02:27:59 PM »
Reply with quote

cool, because i just know that i will screw it up if i try it.  :o if you do end up coding it, please let me know. i can screw around with aspects of it, but i don't know if i can deliver it the way that i really want.
Logged

i thought i hated mathematics and numbers. what the hell happened!
Roundboy
Jr. Member
**
Posts: 72


I pretend to know everything.

ercdvs@hotmail.com WWW
Re:anyone know how i can accomplish this?
« Reply #3 on: September 05, 2002, 04:34:54 PM »
Reply with quote

I actually just coded it now ;)

this is what i needed to do..

1) When submitting a news item, I need to know the member id of my poster ($unum)

2) I then needed to create my TOPIC first.. this is assuming you want it created in the 1st board, which was GENERAL DISCUSSION for me

sql is:
"INSERT INTO ercdvs1.topics VALUES('','1','$unum[0]','$unum[0]','0','0','-1','1','0','0','','0')";
The 5th and 6th '0' are the message id of the first post in the topic, i made it zero for now.

ercvs1.topics is my database.table and $unum[0] is the array value holding my id number

i then need to get the topic id i just created:
$topic_id = mysql_insert_id();
I then create the first message in the topic:

"INSERT INTO ercdvs1.messages VALUES('','$topic_id','$unum[0]','$title','$login_uname','$login_email','$post_time','$memIP','1','','','$body','xx','0','')";
$post_time is time()
$memIP is my ip address

i need to get the message id i just created, to insert it BACK into my new topic..

$msg_id = mysql_insert_id();
"UPDATE ercdvs1.topics SET id_first_msg='$msg_id',id_last_msg='$msg_id' WHERE id_topic='$topic_id'";

This is VERY specific to my front page news system, and I am customising a 1.4.1 board..

my method may be crude, but it works... I dunno if its the most efficient way of doing it, but it works..

i tried to make it as generic as possible .. check it out here:

http://www.winocrossing.com
Logged

I have trouble seperating games from reality...
... I just used a shotgun on my mother, and she's not respawning.
bighired
Noobie
*
Posts: 26


okay... breathe deeply!

WWW
Re:anyone know how i can accomplish this?
« Reply #4 on: September 07, 2002, 04:26:36 PM »
Reply with quote

ummm, i hate to admit this, but i wish i understood this. i love the idea, but i can't make it happen. design graphics, html, no prob... this kills me though.
Logged

i thought i hated mathematics and numbers. what the hell happened!
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  anyone know how i can accomplish this? « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.756 seconds with 21 queries.