Version: , by TECK
Developer Last Online: Nov 2023
Version: Unknown
Rating:
Released: 02-06-2002
Last Update: Never
Installs: 0
No support by the author.
i want to understand why this code does not pull the information as demanded:
PHP Code:
copyrighted code (for now)
i went with the logic. this code should grab the title and content from forum 1 and display only the last 3 threads. for some reasons, it will show ony the latest thread, not the 3 of them. can you tell me why? do i have to connect to the database with a mysql_connect and mysql_select_db?
the idea is to make a "what's new this week" side area where the script can pull the info from an invisible forum. i want to use also a comment script that will let anonymous users post what they think about the event. any help is appreciated. ty for taking the time to read this post.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
$getnewsql=$DB_site->query("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
while ($getnew=$DB_site->fetch_array($getnewsql)) {
$newpagetext=$getnew[pagetext];
$newpagetext=bbcodeparse($newpagetext);
eval("\$newthisweek = \"".gettemplate('home_newthisweek')."\";");
}
to:
PHP Code:
$getnewsql=$DB_site->query_first("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
$newpagetext=$getnew[pagetext];
$newpagetext=bbcodeparse($newpagetext);
eval("\$newthisweek .= \"".gettemplate('home_newthisweek')."\";");
$getnew=$DB_site->query_first("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
$newpagetext=$getnew[pagetext];
$newpagetext=bbcodeparse($newpagetext);
eval("\$newthisweek .= \"".gettemplate('home_newthisweek')."\";");
sorry Chen.. yesterday i was really tired. i did not see the query_first and "." change.
i tried this code:
PHP Code:
$getnewsql=$DB_site->query_first("SELECT * FROM post WHERE threadid='$newthreadid' ORDER BY postid ASC LIMIT 1");
$newtime=vbdate($timeformat,$new[dateline]);
$newdate=vbdate($dateformat,$new[dateline]);
$newpagetext=$new[pagetext];
$newpagetext=bbcodeparse($newpagetext);
it's working great. once again you help people. how do you get the time to do all this?
i decided to remove the code for now. due to copy and paste reasons . with this script basically you will have the same news frontpage as vbulletin.org with a little twist, right Chen? . i will work now on the comments code and also maybe in a category module.. if Firefly is willing to help me a little..
i will see if Firefly accepts for me to release the code here to everyone... but since he never decided to publish his, i will respect his way of administrating this forum. also, i know that i'm not a good PHPer as many code writers here, but i love the challange.. so far PPN and Firefly were very helpfull and pointed me into the right direction with the code. i can only say one word: thanks.
ok firefly . is it ok when i finish the code to email it to you? so you can take a look at it? i'm sure you will find some bugs. the credit will be also into it. (verified and aproved by Firefly) something like that....
i almost finished the comments.php code. i will not use any permissions on this script, so anonymous as well as registered users can post comments. the only difference will be that the anonymous user will have the IP published instead of hidden and will not be allowed to use VB code and smilies.
the comment box will be on the same page where the main news content and other's comments will be displayed. i will keep you all updated here with the progress of this project. i think alot of people will like it.
no prob chen. don't worry about it, i'm in no rush. as long as you can spare a little of your precious time, it's great for me. also, if there are any other hackers who are willing to help me to finalise this hack (i think is a nice idea all the options that i plan to implement), please post your answer in this thread. thanks.