vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vBTopSite (https://vborg.vbsupport.ru/showthread.php?t=59447)

Darkwaltz4 01-02-2004 03:46 PM

This should satisfy you, and no I havent tested it :-p

put this in any file which has access to the forums' global.php

to call it, use this:

$variable = topsites_stats();

and this creates a variable with 17 bits of information, in the following format
$variable[rank][info]

so, to get the 1st site's title, its

$variable[1][site_title]

make sense? for details on what is made available, look at the function yourself.
ADDS TWO QUERIES to the place you call it.

also, it does as many sites as you have in your perpage option. so, if you have 5 sites per page, itll have up to 5 ranks. i have mine set to 10, so i would have 10 ranks available. to use this to create a link on the title, it would look something like this:

1) <a href='topsites_hit.php?action=out&siteid=$variable[1][siteid]' target='_blank'>$variable[1][site_title]</a>

5GB 01-03-2004 12:27 PM

Database error in vBulletin Control Panel 2.3.3:

Invalid SQL: UPDATE topsites_options SET display='2',active='0',require='1',hitson='0',butt ons='http://YOURSITE/topsites/buttons',arrows='http://YOURSITE/topsites',perpage='10',totalbuttons='10',daytime=' 1',htmlallowed='<b><u><i>',bhe ight='31',bwidth='88',bborder='0',resolve='0',rank by='todayunique'
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'require='1',hitson='0',buttons='http://YOURSITE/topsites/button

mysql error number: 1064

i have this problem.. any idea???

AN-net 01-03-2004 04:27 PM

where does the code for function.txt go?

AN-net 01-03-2004 06:59 PM

one of the sites on my top list keeps saying -=bad url=- in site url in acp and also how do i change who the email is sent by for registration and emails?

Darkwaltz4 01-03-2004 06:59 PM

5GB, you are probably using a newer version of mysql and need a better query :-p

find in topsites_admin.php
PHP Code:

if ($action=="dooptions") {
  
$DB_site->query("UPDATE topsites_options SET display='$display',active='$active',require='$require',hitson='$hitson',buttons='$buttons',arrows='$arrows',perpage='$perpage',totalbuttons='$totalbuttons',daytime='$daytime',htmlallowed='$htmlallowed',bheight='$bheight',bwidth='$bwidth',bborder='$bborder',resolve='$resolve',rankby='$rankby'");
  echo 
"<p>Options Updated!</p>";
  
$action "options";


and replace with

PHP Code:

if ($action=="dooptions") {
  
$DB_site->query("UPDATE topsites_options SET display='$display',active='$active','require'='$require',hitson='$hitson',buttons='$buttons',arrows='$arrows',perpage='$perpage',totalbuttons='$totalbuttons',daytime='$daytime',htmlallowed='$htmlallowed',bheight='$bheight',bwidth='$bwidth',bborder='$bborder',resolve='$resolve',rankby='$rankby'");
  echo 
"<p>Options Updated!</p>";
  
$action "options";


also, the function should go into any page you wish to use it on. so if you want it on yuor index, put it on index.php. on top of all the threads? showthread.php

you get the idea

Darkwaltz4 01-03-2004 07:02 PM

if its listing a bad url, then the person who set it set a url which does not exist.

and the email is the $technicalemail var set in config.php, if you want to change it to something else, look through topsites_member.php and topsites_admin.php for $technicalemail, and replace it with "whatever@somewhere.com"

AN-net 01-03-2004 09:14 PM

well the url the member is putting is correct. its http://www.gamersxtc.net

Darkwaltz4 01-03-2004 09:18 PM

well it checks the url using fopen()

it doesnt remove the url from the account, only replaces it with 'bad url' in the acp when you look at the account. sometimes if your site is slow, fopen will time out and just return false to the opening of the site.

AN-net 01-03-2004 09:27 PM

ok thanks darkwaltz4 but im getting confused with the virtual stats. do i put the code in functions.txt in global.php?

Darkwaltz4 01-03-2004 09:30 PM

:-p you put them wherever you plan to use them...

if you wanted to have use of the function on the index page, then place the function in index.php, and also in there, put this line $variable = topsites_stats();

then, in your templates, you can list the top 5 sites like this:

<b>Top 5 Sites!</b><br>
1) <b><a href='$variable[1][site_url]' target='_blank'>$variable[1][site_title]</a></b><br>
2) <b><a href='$variable[2][site_url]' target='_blank'>$variable[2][site_title]</a></b><br>
3) <b><a href='$variable[3][site_url]' target='_blank'>$variable[3][site_title]</a></b><br>
4) <b><a href='$variable[4][site_url]' target='_blank'>$variable[4][site_title]</a></b><br>
5) <b><a href='$variable[5][site_url]' target='_blank'>$variable[5][site_title]</a></b><br>


All times are GMT. The time now is 09:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01126 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete