Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Navigation
Latest Addons
AD Gallery 30
SyntaxHighlighte... 45
Newsletters v4.03 103
Facebook Like Box 117
Newsletters v4.02 55
Metro 148
Facebook Connect 161
Shoutbox Panel 123
Redactor for PHP... 102
MI Floating Side... 105
Facebook Login/R... 146
Avatar Studio v2.03 175
Relationship Sta... 93
Sexual Orientati... 111
Fisherman 138
Popular Addons
iTheme2 5790
Arise 5780
User Control v1.23 4612
Event Calendar 4037
Photowidget panel 3880
Radio-Theme red2... 3346
Highslide Gallery 3307
CSS/JavaScript D... 3219
Facebook Connect... 2973
Dynamic Menu 2886
Slideshow Lightb... 2712
L-AMANT 2654
Enigma 2628
2Dark 2601
Black 2566
View Thread
Official Home of PHP-Fusion » General Addon and Modification Support » Code Snippet and functions
Who is here? 1 guest(s)
 Print Thread
Similar Threads Panel by Matonor
Ankur
Here is the Code for the Panel which shows Similar Threads.
The Code is taken from Matonor's Forum Extensions Panel.
It works for me at 7.02.03.

DEMO (See below the Thread on this Link) :
http://ankurthakur.in/forum/viewthread.php?thread_id=4&pid=4#post_4



if ((FUSION_SELF == 'viewthread.php') && (isset($_GET['thread_id'])))
{
$thread_id = isnum($_GET['thread_id']) ? $_GET['thread_id'] : 0;

if($thread_id){
list($thread_subject) = dbarraynum(dbquery("SELECT thread_subject from ".DB_THREADS." WHERE thread_id=".$thread_id.""));

$rel_thread_res = dbquery("
SELECT tt.thread_id, tt.thread_subject, tf.forum_id, tf.forum_name, tf.forum_access, tt.thread_postcount, tt.thread_lastpost
FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
WHERE MATCH (thread_subject) AGAINST ('".$thread_subject."' IN BOOLEAN MODE) AND thread_id != ".$thread_id." AND ".groupaccess('tf.forum_access')." ORDER BY tt.thread_lastpost DESC LIMIT 5");

if(dbrows($rel_thread_res)){
opentable("Similar Threads");
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n
<tr>
<th class='forum-caption'>".$locale['global_044']."</th>
<th class='forum-caption'>".$locale['global_048']."</th>
<th class='forum-caption'>".$locale['global_046']."</th>
<th class='forum-caption'>".$locale['global_047']."</th>
</tr>\n";
$i = 0;
while($thread = dbarray($rel_thread_res)){
$i++; $row = $i%2 ? " tbl1" : " tbl2";
echo "
<tr>
<td class='tbl".$row."'><a href='".FUSION_SELF."?thread_id=".$thread['thread_id']."'>".$thread['thread_subject']."</a></td>
<td class='tbl".$row."'>".$thread['forum_name']."</td>
<td class='tbl".$row."'>".$thread['thread_postcount']."</td>
<td class='tbl".$row."'>".showdate("forumdate", $thread['thread_lastpost'])."</td>
</tr>";
}

echo "</table>";
closetable();
}
}

}

Edited by Ankur on 06-01-2012 05:13
 
http://ankurthakur.in/
NetriX
Cool. Should implement this someone in my forum system.

Thanks.
PHPFusionMods.com - Serving PHP-Fusion addons since 2007.

www.php-fusion.co.uk/infusions/addondb/img/approved_dev.png
 
http://www.phpfusionmods.com
jikaka
very nice!
www.rusfusion.ru - russian nss
 
www.rusfusion.ru
spunk
Ahhhh very good, thx Ankur!
 
http://www.bdsm-ansichten.com
Ankur
Welcome all... Smile
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
Wanabo
Ankur wrote:


$i++; $row = $i%2 ? "1" : "2";
$i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";


Remove $i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";
or place // before $i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";
for correct table class view.
KPN Gebruikers Groep, my largest pHp-Fusion site about an ISP.
pHp-Fusion.Org, tutorials to enhance php-fusion.
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support site. Send PB for info.
 
http://ziggo.gebruikers.eu
DrunkeN
wanabo wrote:

Ankur wrote:


$i++; $row = $i%2 ? "1" : "2";
$i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";


Remove $i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";
or place // before $i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";
for correct table class view.


Here is it i always use

Before => while()
$i = 0;

After => while()
$class = ($i % 2 == 0 ? "tbl1" : "tbl2"Wink;

".$class." on all => class=''

and $i++; before the while() end

Dark Fusion - PHP Fusion v7 Mods , Tutorials , Support
 
http://dark-fusion.se
Ankur
Remove $i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";
or place // before $i++; $row = $i%2 ? " class='tbl1'" : " class='tbl2'";
for correct table class view


Oops... I forgot that... I just added the code here... Thanks :D

DrunkeN wrote:

Here is it i always use

Before => while()
$i = 0;

After => while()
$class = ($i % 2 == 0 ? "tbl1" : "tbl2");

".$class." on all => class=''

and $i++; before the while() end


Same with me bro... ;)
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
Wanabo
@Ankur can you port the code from Matonor to the profile.php file so the users post and threads can be viewed? (stats)
KPN Gebruikers Groep, my largest pHp-Fusion site about an ISP.
pHp-Fusion.Org, tutorials to enhance php-fusion.
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support site. Send PB for info.
 
http://ziggo.gebruikers.eu
Ankur
wanabo wrote:

@Ankur can you port the code from Matonor to the profile.php file so the users post and threads can be viewed? (stats)


Let me see if I can. I will notify you here when completed. Cool
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
spunk
Im a little bit confused, how looks the actually code now?
 
http://www.bdsm-ansichten.com
DrunkeN
Here is the part from Matonors code for profile stats. This will show the user stats part on profile.php page just install it via panel admin and set on lower panel and display on all pages.
DrunkeN attached the following file:
forum_extension_panel_profile_only.zip [15.84kB / 163 Downloads]

Dark Fusion - PHP Fusion v7 Mods , Tutorials , Support
 
http://dark-fusion.se
Wanabo
Thanks DrunkeN! I played with this code before but didn't get it working the right way.

Now I played with the code again and succeeded to adapt it to my wishes.

I integrated the panel code in profile.php, restored locale settings and added stats hidden for guests (no need to hammer the database Wink)

Modified profile.php is attached. You need the original forum_extension_panel from Matonor in your infusion directory to make use of the different locale files.
Wanabo attached the following file:
profilephp_plus_stats.zip [3.28kB / 168 Downloads]

KPN Gebruikers Groep, my largest pHp-Fusion site about an ISP.
pHp-Fusion.Org, tutorials to enhance php-fusion.
pHp-Fusion.Asia & pHp-Fusion.Fr & pHp-Fusion.Cn are available for a localized support site. Send PB for info.
 
http://ziggo.gebruikers.eu
Ankur
DrunkeN wrote:

Here is the part from Matonors code for profile stats. This will show the user stats part on profile.php page just install it via panel admin and set on lower panel and display on all pages.


So quick... Well done Robin... Thanks for that... Smile

wanabo wrote:

Thanks DrunkeN! I played with this code before but didn't get it working the right way.

Now I played with the code again and succeeded to adapt it to my wishes.

I integrated the panel code in profile.php, restored locale settings and added stats hidden for guests (no need to hammer the database Wink)

Modified profile.php is attached. You need the original forum_extension_panel from Matonor in your infusion directory to make use of the different locale files.


Thanks for sharing... Smile
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
Craig
I think it's post #1 code that is destroying the layout!! Anyway Domi knows about it, sure he will find a solution. Smile
 
http://www.fusiontube.co.uk/
XDyNaZTy
Parse error: syntax error, unexpected '}' in /homepages/11/d389978892/htdocs/themes/templates/panels.php(72) : eval()'d code on line 38

Any help?
 
PHPar
XDyNaZTy wrote:

Parse error: syntax error, unexpected '}' in /homepages/11/d389978892/htdocs/themes/templates/panels.php(72) : eval()'d code on line 38

Any help?


remove last } in the code

because its Plus .
 
XDyNaZTy
Hi

I added a new website to my server and now I'm getting this error when trying to install this same code.

Parse error: syntax error, unexpected T_STRING in /homepages/11/d389978892/htdocs/JuvenileRacing/themes/templates/panels.php(74) : eval()'d code on line 13
 
Ankur
XDyNaZTy wrote:

Hi

I added a new website to my server and now I'm getting this error when trying to install this same code.

Parse error: syntax error, unexpected T_STRING in /homepages/11/d389978892/htdocs/JuvenileRacing/themes/templates/panels.php(74) : eval()'d code on line 13


UPDATED the CODE in Post#1. Please Use that !
ankurthakur.co.cc/images/freelancer.png
 
http://ankurthakur.in/
wheeler
Where exactly would i put this, in viewthread.php - Coming up with some errors, could you help - thanks!

Merged on Jan 06 2012 at 12:31:22:
Nethermind, Sorted it - Thanks
Edited by wheeler on 06-01-2012 12:31
Michael Wheeler
 
Jump to Forum:
Similar Threads
Thread Forum Replies Last Post
Link panel to another subdomain Content Administration 3 19-05-2013 08:50
Stop Forum Spam Panel Official releases [Panels] 14 12-05-2013 19:51
edit login side panel. Content Administration 3 10-05-2013 18:45
Theme Control Panel Content Administration 2 08-05-2013 13:19
Add buttons to login panel Content Administration 3 06-05-2013 19:24
Official Home of PHP-Fusion uses cookies. Some may already have been set. Read more about our Cookies here.
Please click the button I Consent Cookies to hide this bar and accept our cookies. If you continue to use the site with no action taken, we'll assume that you consent our cookies anyway.
Cookiebar Panel byVenue