Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
latest threads and latest posts in phpbb
Old 06-15-2005, 12:20 PM latest threads and latest posts in phpbb
lajkonik86's Avatar
Ultra Talker

Posts: 389
Trades: 0
Trying to show the latest threads the user started and the latest threads a user posted in.
I'm having 2 problems
- Don't show threads the user has started under threads a user posted in
- If a user has multiple post in one threads don't show thread multiple times

PHP Code:
//Mythreads Latest you started
$Recordset1 mysql_query("SELECT * FROM `phpbb_topics` WHERE `topic_poster` = 2 ORDER BY `topic_time` DESC LIMIT 0 , 4") or die(mysql_error());
        
$totalRows_Recordset1 mysql_num_rows($Recordset1);
        
$blue 0;
        while (
$results mysql_fetch_array($Recordset1)) 
                    {
                                
$id[$blue] = $results[topic_id];
                             
$title[$blue] = $results[topic_title];
                             
$blue++;                
                             if (
$blue == 5) break;
                    }
echo 
"Threads you started:<br>";
$blue 0;
while (
$blue 4) {
echo 
"<a href=\"http://www.top-download.net/forum/viewtopic.php?t=$id[$blue]\">$title[$blue]</a><br>";
$blue++;
}

//Mythreads Latest you posted in
$Recordset1 mysql_query("SELECT * FROM `phpbb_posts` WHERE `poster_id` = 2 ORDER BY `post_time` DESC LIMIT 0 , 4") or die(mysql_error());
        
$totalRows_Recordset1 mysql_num_rows($Recordset1);
        
$blue 0;
        while (
$results mysql_fetch_array($Recordset1)) 
                    {
                                
$id[$blue] = $results[topic_id];
                             
$title[$blue] = $results[topic_title];
                             
$blue++;                
                             if (
$blue == 5) break;
                    }
echo 
"Topics you posted in:<br>";
$blue 0;
while (
$blue 4) {
echo 
"<a href=\"http://www.top-download.net/forum/viewtopic.php?t=$id[$blue]\">topic$blue</a><br>";
$blue++;

Help is greately appreciated
__________________
Know what to Download

Please login or register to view this content. Registration is FREE
lajkonik86 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-17-2005, 06:26 AM
lajkonik86's Avatar
Ultra Talker

Posts: 389
Trades: 0
Fixed the duplicate
Now trying to exclude the threads a user started:
$id is an array, naturally this code doesn't work. How do i tell it to exclude all values in the array id??

$Recordset1 = mysql_query("SELECT DISTINCT `topic_id`
FROM `phpbb_posts`
WHERE `poster_id` =2
AND `topic_id` != '$id'
ORDER BY `post_time` DESC
LIMIT 0 , 4") or die(mysql_error());
__________________
Know what to Download

Please login or register to view this content. Registration is FREE
lajkonik86 is offline
Reply With Quote
View Public Profile
 
Old 06-17-2005, 11:02 AM
lajkonik86's Avatar
Ultra Talker

Posts: 389
Trades: 0
Fixed problem of duplicated and added name of post query.
One problem left
PHP Code:
//Mythreads Latest you posted in
$Recordset2 mysql_query("SELECT DISTINCT `topic_id` FROM `phpbb_posts` WHERE `poster_id` =2
AND `topic_id` != '
$id' ORDER BY `post_time` DESC LIMIT 0 , 4") or die(mysql_error());
$blue 0;
while (
$results mysql_fetch_array($Recordset2)) 
                    {

                                
$id[$blue] = $results[topic_id];
                             
$title[$blue] = $results[topic_title];
                             
$blue++;        
                             if (
$blue == 5) break;
                    }
$Recordset2 mysql_query("SELECT * FROM `phpbb_topics`") or die(mysql_error());
while (
$results mysql_fetch_array($Recordset2)) 
                    {

                             
$names["$results[topic_id]"] = $results[topic_title];
                    } 
__________________
Know what to Download

Please login or register to view this content. Registration is FREE
lajkonik86 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to latest threads and latest posts in phpbb
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17105 seconds with 12 queries