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)

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

i get this error when i put the $variable = topsites_stats(); after the code from function.txt

error:
Quote:

Fatal error: Call to a member function on a non-object in /home/anima823/public_html/community/index.php on line 23

Darkwaltz4 01-03-2004 10:08 PM

oh, i think i know what the problem is

in the function, after

function topsites_stats() {

put:

global $DB_site;

should work then (i havent tested any of this)

AN-net 01-03-2004 10:12 PM

ok i no longer get an error but now on my forum home where i put the variable for site title of which ever is rank #1 i get this:
Quote:

Array[site_title]

Darkwaltz4 01-03-2004 10:17 PM

$topsites_array[#][siteid]
$topsites_array[#][site_url]
$topsites_array[#][site_title]
$topsites_array[#][site_webmaster]
$topsites_array[#][site_description]
$topsites_array[#][today_in]
$topsites_array[#][today_out]
$topsites_array[#][today_unique]
$topsites_array[#][today_hits]
$topsites_array[#][total_in]
$topsites_array[#][total_out]
$topsites_array[#][total_hits]
$topsites_array[#][total_unique]
$topsites_array[#][average_unique]
$topsites_array[#][average_out]
$topsites_array[#][average_hits]
$topsites_array[#][average_in]

make sure your typing it right in your templates: from $variable = topsites_stats();
the the title of the first should be $variable[1][site_title]

AN-net 01-03-2004 10:18 PM

this is wut i put in my forumhome template:
$variable[1][site_title]

Darkwaltz4 01-03-2004 10:38 PM

why dont you just try doing this...remove the function, remove the line, and put this where you originally had the line:

PHP Code:

    $today date("m-d-y");
    
$maketime explode("-"$today);
    
$today mktime0,0,0,$maketime[0],$maketime[1],$maketime[2]);

    
$options $DB_site->query_first("SELECT * FROM topsites_options");
    
$resetlast $today-(($options[daytime]-1)*86400);

    if(
$options[display]==3) {
        
$allmembers $DB_site->query("SELECT * FROM topsites_sites WHERE active>0 AND totalhits>0 ORDER BY $options[rankby] DESC LIMIT $options[perpage]");
    } elseif(
$options[display]==2) {
        
$allmembers $DB_site->query("SELECT * FROM topsites_sites WHERE active>0 AND lastreset>=$resetlast ORDER BY $options[rankby] DESC LIMIT $options[perpage]");
    } else {
        
$allmembers $DB_site->query("SELECT * FROM topsites_sites WHERE active>0 ORDER BY $options[rankby] DESC LIMIT $options[perpage]");
    }

    
$fn 1;
    while(
$site $DB_site->fetch_array($allmembers)) {

    
$daysjoined ceil((($today $site[joindate]) / 86400)+1);

    if(!
eregi("^http://",$site[siteurl])) {
    
$site[siteurl] = "http://".$site[siteurl];
    }

    
$topsites_array[$fn][siteid]         = $site[siteid];
    
$topsites_array[$fn][site_url]         = $site[siteurl];
    
$topsites_array[$fn][site_title]     = $site[sitetitle];
    
$topsites_array[$fn][site_webmaster]     = $site[webmaster];
    
$topsites_array[$fn][site_description]     = $site[sitedescription];
    
$topsites_array[$fn][today_in]         = $site[todayin];
    
$topsites_array[$fn][today_out]         = $site[todayout];
    
$topsites_array[$fn][today_unique]     = $site[todayunique];
    
$topsites_array[$fn][today_hits]     = $site[todayhits];
    
$topsites_array[$fn][total_in]         = $site[totalin];
    
$topsites_array[$fn][total_out]         = $site[totalout];
    
$topsites_array[$fn][total_hits]     = $site[totalhits];
    
$topsites_array[$fn][total_unique]     = $site[totalunique];
    
$topsites_array[$fn][average_unique]     = floor$site[totalunique] / $daysjoined );
    
$topsites_array[$fn][average_out]     = floor$site[totalout] / $daysjoined );
    
$topsites_array[$fn][average_hits]     = floor$site[totalhits] / $daysjoined );
    
$topsites_array[$fn][average_in]     = floor$site[totalin] / $daysjoined );

    
$fn++;
    } 

then you can use the array $topsites_array, the same way you previously were using $variable

AN-net 01-03-2004 11:05 PM

hmm, i keep getting ARRAY[site_title]

Darkwaltz4 01-03-2004 11:05 PM

hmm ill install this somewhere and see how it works. watch for me to edit this post with my findings

EDIT: i just tried both the function method and the straight method. both worked perfectly.....show me the code you have in your template (a larger portion of it)

5GB 01-04-2004 04:42 AM

Database error in vBulletin Control Panel 2.3.3:

Invalid SQL: UPDATE topsites_options SET display='2',active='1','require'='1',hitson='1',bu tton s='http://forums.sgwdc.com/images/sgwdc/topsite/',arrows='http://forum.sgwdc.com/images/sgwdc/topsite',perpage='10',totalbuttons='10',da ytime='1',htmlallowed='<b><u><i>',bheight='31',bwi dth='88', bborder='0',resolve='0',rankby='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='1',button s='http://forums.sgwdc.com/ima

mysql error number: 1064

Date: Sunday 04th of January 2004 02:40:54 PM
Script: http://forums.sgwdc.com//admin/topsites_admin.php
Referer: http://forums.sgwdc.com/admin/topsit...ction=options&


After i edited.. =x please help

Darkwaltz4 01-04-2004 04:45 AM

sorry, i gave you the wrong quotes for the require section...

(maybe i should change the column for that...its caused too many issues :-p)

anyway, change (what you have) 'require'=
to `require`=
(the backwards apostraphe..not sure what its called) also, when your done, if you give me your link ill add it to the first post ^_^


All times are GMT. The time now is 09:28 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.01104 seconds
  • Memory Usage 1,773KB
  • 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
  • (1)bbcode_php_printable
  • (2)bbcode_quote_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