Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
upgraded to vb, trying to re-install my previous feature Details »»
upgraded to vb, trying to re-install my previous feature
Version: , by Shepski Shepski is offline
Developer Last Online: Apr 2008 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-05-2002 Last Update: Never Installs: 0
 
No support by the author.

Hi all,

On my last board (XMB) I changed the main forum home code to display next to one of the categories (Trading) a list of top traders. This list was generated by me adding into the XMB code where it makes up the forum list to 'include' a php file if the forumid equalled the one for the trading forum. this then pulled the info from another database and then displayed it by the side of the trading forum name.

Unfortunaltely, I have deleted my original board before checking how i did it but with vb I am struggling to find where to put the code. Can anyone point me in the right direction to do this?

thanks

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-05-2002, 11:42 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you'll have to edit index.php and there the makeforumbit function...

just before this line:
PHP Code:
eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";"); 
Reply With Quote
  #3  
Old 08-05-2002, 12:13 PM
Shepski Shepski is offline
 
Join Date: Jul 2002
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for that.

I have been trying to get it working but i cant seem to figure out how to add the data next to the category name. all it seems to do so far is try and add the data to every forum within the category.

take a look at my forum home page, I am trying to get the 'include'ed file to display next to DVD Related which is a category but has forum number 23. here is my inserted code:

Code:
if ($forumid=="23"){
    $temp = include("topt.php");
    $forum[title] = "$forum[title] - $temp";
}
to see what data i will be displaying next to category name click here

I hope you can understand what I am trying to do, I find it difficult trying to explain this!
Reply With Quote
  #4  
Old 08-05-2002, 12:21 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have your topt.php a return function in it?
http://www.php.net/manual/en/function.include.php
if not you've to add it...

also it would help to share your topt.php with use, so we can give better advices
Reply With Quote
  #5  
Old 08-05-2002, 12:40 PM
Shepski Shepski is offline
 
Join Date: Jul 2002
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I didnt use return (mainly cos i didnt know it existed!) but i did have to reconnect back to the forums database. This code worked when used with XMB.

Code:
<?
$i = 0;
$count = 0;

$link2=mysql_pconnect("host", "user", "pass");
mysql_select_db('dbname',$link2);
$query="SELECT n0s_users.id, n0s_users.fname, COUNT(n0s_comments.uid) AS comments
FROM n0s_users INNER JOIN n0s_comments ON (n0s_users.id=n0s_comments.uid)
GROUP BY n0s_users.id ORDER BY comments DESC, n0s_users.fname ASC LIMIT 10";

$result=mysql_query($query) or die(mysql_error());
$numrows=mysql_num_rows($result);

if ($numrows!=0) {
   while($row=mysql_fetch_assoc($result)) {
       $count = $count + 1;
		if ($count==10){
			   echo "<span style=\"font-size: 8pt;\">$count <a href=\"http://users.dvd-swaps.co.uk/user.php?id=$row[id]\" target=_blank>$row[fname]</a></span>";
		} else {
        	   echo "<span style=\"font-size: 8pt;\">$count <a href=\"http://users.dvd-swaps.co.uk/user.php?id=$row[id]\" target=_blank>$row[fname]</a> - </span>";
		}
//        echo "$count <a href=\"http://users.dvd-swaps.co.uk/user.php?id=$row[id]\">$row[fname]</a> - <b>$row[comments]</b>  ";

        }
}
//reconnect to orginal forum database
mysql_pconnect('host', 'username', 'password') or die(mysql_error());
mysql_select_db('dbname') or die(mysql_error());
?>
Reply With Quote
  #6  
Old 08-05-2002, 01:47 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should change it to this:

Code:
<?
$i = 0;
$count = 0;
$temp="";

$link2=mysql_pconnect("host", "user", "pass");
mysql_select_db('dbname',$link2);
$query="SELECT n0s_users.id, n0s_users.fname, COUNT(n0s_comments.uid) AS comments
FROM n0s_users INNER JOIN n0s_comments ON (n0s_users.id=n0s_comments.uid)
GROUP BY n0s_users.id ORDER BY comments DESC, n0s_users.fname ASC LIMIT 10";

$result=mysql_query($query) or die(mysql_error());
$numrows=mysql_num_rows($result);

if ($numrows!=0) {
   while($row=mysql_fetch_assoc($result)) {
       $count = $count + 1;
		if ($count==10){
			   $temp .= "<span style=\"font-size: 8pt;\">$count <a href=\"http://users.dvd-swaps.co.uk/user.php?id=$row[id]\" target=_blank>$row[fname]</a></span>";
		} else {
        	   $temp .= "<span style=\"font-size: 8pt;\">$count <a href=\"http://users.dvd-swaps.co.uk/user.php?id=$row[id]\" target=_blank>$row[fname]</a> - </span>";
		}
//        echo "$count <a href=\"http://users.dvd-swaps.co.uk/user.php?id=$row[id]\">$row[fname]</a> - <b>$row[comments]</b>  ";

        }
}
//reconnect to orginal forum database
mysql_pconnect('host', 'username', 'password') or die(mysql_error());
mysql_select_db('dbname') or die(mysql_error());

return $temp
?>
then it should work
Reply With Quote
  #7  
Old 08-05-2002, 02:37 PM
Shepski Shepski is offline
 
Join Date: Jul 2002
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks, it works

had to make one change being:

Code:
if ($forum[forumid]=="23"){
so it now displays next to the category

click link in my sig to see the final result

many thanks for your help
Reply With Quote
  #8  
Old 08-06-2002, 01:39 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


you're welcome
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 06:17 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06612 seconds
  • Memory Usage 2,274KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete