View Full Version : vBTopSite
Darkwaltz4
12-29-2003, 10:00 PM
vBTopSite - Used from 2.2.9 - 2.3.3, should work on all 2.x
Description: Topsites script for people who's sites revolve around vbulletin.
This script I actually wrote several months ago, and now I finally decided to release them on vb.org.
There are some things which I have not included in this version, but they will be released here as I am satisfied with them:
All functions appearing in 'Useful Admin Functions' in the ACP
Everything else works. ^_^ now anyway, features...
Topsites Features: [in no order, partial list]
Works with all vb things, like it shuts off with your forums, and Banned people have no access.
Secure Member Panel
Seperate Member Base, user need not be joined to forums to join/view topsites
Secure Retrieval System
Stats rendered in real-time
'Today' Reset system
Customizable stat display in the sitecell template. [instructions for that if you ask me]
Tracks 12 stats, rankable by 9
Not a 'clicking required' topsites, displaying buttons earns hits
E-mail verification system
Allow certain HTML in description
Display filters for accounts which arent displaying the button
Comprehensive who's online locations
Admin Features: [in no order, partial list]
Topsites active y/n
Hit accruing active y/n
E-mail verification required (activation) y/n
Urls to buttons, arrows (for placing buttons remotely even)
Length of 'day' for reset purposes, 1 for daily, 0 to disable
Allowed HTML in description (blank for full stripping)
Option to resolve bad button urls -> replacing them with the rank button
Display filter (explained in the acp, or ask me for more details)
Set which stat to rank by
Edit/delete sites
SEARCH site database
Editing page features links to view submitted button, auto-checks validity of urls
Automatic emailing script: send to specific site/all sites/inactivated sites/activated sites
Displays stats [but not allowing editing]
View topsites from acp
**Force 'day' reset of unreset sites
**Force 'day' reset particular site
**Force 'day' reset of ALL sites
**Prune sites which joined from DATE, from all sites/inactivated/activated
**Clean up IP table of old hits/hits from pruned sites
**Flush hits from particular site
**Flush hits from site older than DATE
** = Will be appearing on vb.org shortly.
It is advised anyone who uses this hack, to click install, because of the nice updating thing i can do,
and like i said, there will be updates in a little while.
LIVE VERSION: http://forums.ffgon.com/topsites.php
Feel free to join if you are a Final Fantasy site ^_^ [ignore the popups, they dont appear if you are logged into the forums]
MORE:
http://www.animationation.net/community/topsites.php
http://www.bluelaguna.net/forum/topsites.php
http://www.orbsydia.com/forum/topsites.php
anyway, i might post screenshots, but the admin stuff isnt much to see, i basically just explained it up there ^ :-p
If you have any questions, etc, post them
FYI: a more advanced script is in the works by me, which will be free from vbulletin and including many more features,
like a user rating/comment system. This will be 10$ or so, and more details are available if you pm me (dont discuss it here)
Thank you for using this hack! i know i dont usually post my stuff, well here you go ^_^
Roxie
12-30-2003, 09:05 PM
I will try it out. :) Looks good.
Roxie
12-30-2003, 09:12 PM
What should the rank and default buttons look like?
Darkwaltz4
12-30-2003, 09:15 PM
Anything you would like. genereally they are little 31hx88w pixel images, with numbers on them.
oh, i should add that each image be saved X.gif, where X is the number that it is.
Darkwaltz4
12-30-2003, 09:30 PM
erm, missing more instructions >.<
open up the file called 'sinc.php'
and update the information contained at the top. its your db name, password, user, basically what appears in config.php of your admin/ folder.
this is used in the hit file, and because of it hits arent as server intensive as they would have been.
EDIT: zip file updated with last two changes
Roxie
12-30-2003, 09:34 PM
Where should that file be uploaded? The instructions don't say.
Also, I don't see the new zip.
Darkwaltz4
12-30-2003, 09:38 PM
ah...i guess it is updating the upload >.> vb3 does that...
well, it was just instruction changes
and create a folder anywhere you want, on any site you want.
add the buttons you make to it. be sure to create a 'default.gif' image. (numberless) remember the url you place them in, so you can fill it in upon doing your options
ill attach it again here EDIT, nm -_- stupid vb3...now the attachment is 'being uploaded' oh well
Roxie
12-30-2003, 09:42 PM
So, upload the sinc.php anywhere? lol. I'm not getting it.
Darkwaltz4
12-30-2003, 09:45 PM
in sinc.php, find
<?php
error_reporting(7);
$servername="localhost";
$dbusername="";
$dbpassword="";
$dbname="";
$technicalemail = "";
$usepconnect = 0;
and fill out the corresponding values with what appears in your admin/config.php file
// type of database running
// (only mysql is supported at the moment)
$dbservertype = 'mysql';
// hostname or ip of server
$servername = 'localhost';
// username and password to log onto db server
$dbusername = 'db_user';
$dbpassword = 'db_pass';
// name of database
$dbname = 'db_name';
// technical email address - any error messages will be emailed here
$technicalemail = 'YOUR_NAME@SOMETHING.com';
// use persistant connections to the database
// 0 = don't use
// 1 = use
$usepconnect = 0;
its that easy, sinc.php is actually a boiled down version of alot of pages, for the mere fact of connecting to the db during the topsites_hit.php page
Roxie
12-30-2003, 09:48 PM
*trying not to sound like a complete idiot* Okay..I know all that, but where should I upload the file. To the main directory or the admin. lol
sweet22
12-30-2003, 09:52 PM
there is no attachment or download for the topsite
Roxie
12-30-2003, 10:00 PM
I am having to do the queries manually and I got this error with the first one:
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unclosed quote @ 108
STR: '
SQL: CREATE TABLE topsites_ips (
ipin int(10) NOT NULL auto_increment,
address varchar(14) NOT NULL default \'\',
siteid int(5) NOT NULL default \'0\',
dateadd int(20) NOT NULL default \'0\',
PRIMARY KEY (ipin)
) TYPE=MyISAM
SQL-query :
CREATE TABLE topsites_ips ( ipin int(10) NOT NULL auto_increment, address varchar(14) NOT NULL default \'\', siteid int(5) NOT NULL default \'0\', dateadd int(20) NOT NULL default \'0\', PRIMARY KEY (ipin) ) TYPE=MyISAM
MySQL said:
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 '\'\',
siteid int(5) NOT NULL default \'0\',
dateadd int(20)
Darkwaltz4
12-30-2003, 10:06 PM
UGH THIS IS GETTING ANNOYING NOW....blame vbhackmaker, here use this
CREATE TABLE topsites_ips (
ipin int(10) NOT NULL auto_increment,
address varchar(14) NOT NULL default '',
siteid int(5) NOT NULL default '0',
dateadd int(20) NOT NULL default '0',
PRIMARY KEY (ipin)
) TYPE=MyISAM;
CREATE TABLE topsites_options (
active tinyint(1) NOT NULL default '0',
hitson tinyint(1) NOT NULL default '0',
perpage tinyint(3) NOT NULL default '10',
daytime tinyint(2) NOT NULL default '1',
require tinyint(1) NOT NULL default '1',
buttons varchar(75) NOT NULL default '',
totalbuttons int(3) NOT NULL default '50',
resolve tinyint(1) NOT NULL default '0',
display tinyint(1) NOT NULL default '1',
htmlallowed varchar(75) NOT NULL default '<b><u><i>',
bheight tinyint(3) NOT NULL default '0',
bwidth tinyint(3) NOT NULL default '0',
bborder tinyint(3) NOT NULL default '0',
arrows varchar(75) NOT NULL default '',
rankby varchar(75) NOT NULL default 'todayunique',
KEY active (active)
) TYPE=MyISAM;
CREATE TABLE topsites_sites (
siteid int(3) NOT NULL auto_increment,
siteurl varchar(75) NOT NULL default '',
sitetitle varchar(75) NOT NULL default '',
webmaster varchar(30) NOT NULL default '',
webemail varchar(50) NOT NULL default '',
sitedescription text NOT NULL,
sitepassword varchar(30) NOT NULL default '',
buttonurl varchar(75) NOT NULL default '',
totalhits int(10) unsigned NOT NULL default '0',
totalout int(10) unsigned NOT NULL default '0',
totalunique int(10) unsigned NOT NULL default '0',
totalin int(10) unsigned NOT NULL default '0',
todayin int(10) unsigned NOT NULL default '0',
todayunique int(10) unsigned NOT NULL default '0',
todayout int(10) unsigned NOT NULL default '0',
todayhits int(10) unsigned NOT NULL default '0',
lastreset int(20) NOT NULL default '0',
lastrank int(20) NOT NULL default '0',
joindate int(20) NOT NULL default '0',
active tinyint(1) NOT NULL default '0',
PRIMARY KEY (siteid),
UNIQUE KEY siteurl (siteurl,webmaster,webemail,buttonurl)
) TYPE=MyISAM;
INSERT INTO topsites_options VALUES (0, 0, 10, 1, 1, 'http://YOURSITE/topsites/buttons', 10, 0, 2, '<b><u><i>', 31, 88, 0, 'http://YOURSITE/topsites', 'todayunique');
---------------------------------
find forum/global.php
----
if (!$servertoobusy) {
require('./admin/sessions.php');
----
replace with
----
if (!$servertoobusy) {
if($PHP_SELF != "/topsites_hit.php") {
require('./admin/sessions.php');
}
find in admin/index.php
----------
makenavoption("Add","announcement.php?action=add","|");
makenavoption("Modify","announcement.php?action=modify");
makenavselect("Announcements");
add below
// *************************************************
makenavoption("Options","topsites_admin.php?action=options"," | ");
makenavoption("Manage Sites","topsites_admin.php?action=site","<br/>");
makenavoption("Useful Admin Functions","topsites_admin.php?action=functs","<br/>");
makenavoption("Send Emails","topsites_admin.php?action=email"," | ");
makenavoption("View","../topsites.php?page=1","<br/>");
makenavselect("vBTopSite");
*sigh* i think i remember why i dont release hacks here, lol
and yeah...............................vb3 is in the process of 'updating the attachment' =_= which means it might not be available until tomarrow...stupid thing. if you click install, ill be able to update you when it returns
Roxie
12-30-2003, 10:17 PM
I'm getting errors with all the queries now....I'm going to hold off on installing until you get the file updated. Then I'll try again.
Darkwaltz4
12-30-2003, 11:27 PM
Okay, the update is there, i took out the vbhacker stuff, and added all of the instructions which you will need, and that should be everything *heavy sigh* now, this is really ruining my credibility isnt it, lol. Just follow the instructions, vbhacker sucks i just found out, when you are trying to make your own with vbhackmaker.
ULTIMATESSJ
12-30-2003, 11:35 PM
One small question
I have my forums installed on a subdomain (for example http://forum.mysite.com). Say i wanted this topsite page to appear on the normal site (example again http://www.mysite.com/topsite.php), what would i need to do?
Darkwaltz4
12-30-2003, 11:39 PM
hmmmm....im just guessing, but you might be able to do it if you put the full url into the include file to global.php of your fourms (which it needs to run) however i have a feeling this wont work, because then youll have to edit all the requires in the global.php file....you might try it, but i seriously dont think it will work without some annoyance experienced on your end.
this is one of the problems, which is solved by being free of vb in the version i mentioned above :-p because some people dont like the topsites to be dependant on the forums.
AN-net
12-31-2003, 05:51 AM
i seem to be having problems with the second db query>_<
edit:
im having problems with the topsites_options:
specifically:
'require tinyint( 1 ) NOT NULL default '1',
buttons varchar(
Darkwaltz4
12-31-2003, 03:32 PM
which version of mysql are you running? the sql statements should all be run through phpmyadmin, after all i used phpmyadmin to render the statements in the first place, lol (using the view dump schema thing)
on a side note, if anyone actually gets this running on their site, mind posting a link? :D i might even list it at the top or something
MindTrix
12-31-2003, 03:38 PM
Sounds good, nice job ;)
Hope you get the problems fixed soon
Darkwaltz4
12-31-2003, 03:40 PM
the current problem for right now: seems to just be AN-net with the second query
all the problems from previous posts, were trouble with: vb3's attachment process >.> and also vbhacker not liking the vbhackmacker file i used (so i rewrote the instructions without use of vbhacker) and then it became less annoying ^_^
yeah, so anyone returning, ignore most of the above posts >.>
AN-net
12-31-2003, 04:10 PM
im using Mysql version: 4.0.15-standard
AN-net
12-31-2003, 04:26 PM
MySQL said:
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 tinyint( 1 ) NOT NULL default '1',
buttons varchar(
i still get that
i having no experience with sql syntax would assume the word require is messing it up, i dont know just a hunch
Darkwaltz4
12-31-2003, 04:33 PM
AHA, i know whats going on, and i might update the query in the install file if this keeps up a problem >.>
CREATE TABLE `topsites_options` (
`active` tinyint( 1 ) NOT NULL default '0',
`hitson` tinyint( 1 ) NOT NULL default '0',
`perpage` tinyint( 3 ) NOT NULL default '10',
`daytime` tinyint( 2 ) NOT NULL default '1',
`require` tinyint( 1 ) NOT NULL default '1',
`buttons` varchar( 75 ) NOT NULL default '',
`totalbuttons` int( 3 ) NOT NULL default '50',
`resolve` tinyint( 1 ) NOT NULL default '0',
`display` tinyint( 1 ) NOT NULL default '1',
`htmlallowed` varchar( 75 ) NOT NULL default '<b><u><i>',
`bheight` tinyint( 3 ) NOT NULL default '0',
`bwidth` tinyint( 3 ) NOT NULL default '0',
`bborder` tinyint( 3 ) NOT NULL default '0',
`arrows` varchar( 75 ) NOT NULL default '',
`rankby` varchar( 75 ) NOT NULL default 'todayunique',
KEY `active` ( `active` )
) TYPE = MyISAM ;
there, the problem (thanks for putting the entire error message) was that the word 'require' is a reserved word, and to use it in a table requires that you quote it to work *edit: just verified this*
AN-net
12-31-2003, 04:35 PM
yeah it works! Thanks so much ^.^
MindTrix
12-31-2003, 04:51 PM
all the problems from previous posts, were trouble with: vb3's attachment process >.>
What do you mean by that?
Darkwaltz4
12-31-2003, 04:54 PM
it doesnt update right away (and ive used vb3 gamma, so ive seen the timed updating things)
so basically i sat there sweating, while many people came and went, seeing i had no attachment, when all vb3 had to say about it was 'updating'
ultimately, it deleted the attachment (?) (no not me) and i had to upload a new one
AN-net
12-31-2003, 04:59 PM
im getting this now when i fill in the options in admin cp and hit save changes:
Database error in vBulletin Control Panel 2.3.2:
Invalid SQL: UPDATE topsites_options SET display='1',active='1',require='1',hitson='1',butt ons='http://www.animationation.net/community/images/topsite/',arrows='ttp://www.animationation.net/community/images/topsite/',perpage='10',totalbuttons='50',daytime='0',htmla llowed='',bheight='31',bwidth='88',bborder='1',res olve='0',rankby='totalunique'
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',buttons='http://www.animationation.net/c
mysql error number: 1064
Date: Wednesday 31st of December 2003 07:58:38 PM
Script: http://www.animationation.net/community/community/admin/topsites_admin.php
Referer: http://www.animationation.net/community/admin/topsites_admin.php?action=options&
MindTrix
12-31-2003, 04:59 PM
Oh right i thought you meant it was a problem with it working on vB3, in which case im sure you can guess what my response would have been :)
Thank you for clearing that up for me.
AN-net
12-31-2003, 05:03 PM
where should i put that and should i fix the admin file for the topsite?
where did darkwaltz's post go?????????
Darkwaltz4
12-31-2003, 05:05 PM
heh, yeah i know i know, i cant code that mess called vb3 [yet]...at least until i figure out the whole template thing, all over again (theres like 3 types now >.<)
anyway, there is definately a different-version issue at work here, with the 'require' column i told you about. to fix it, open up the topsites_ammin.php, and put quote around the query that updates topsites_options
_everywhere_ you see:
-----------
require='
-----------
replace with
-----------
`require`='
-----------
and also, when you get it working, mind posting a link to it? that would be cool ^_^
wow, so now i know what to include in the next version (which ill work on when everyone is good with this one)
AN-net
12-31-2003, 05:15 PM
ok this time when i submitted the options it did "update" the options table from admin cp perspective by saying "options updated" but when i went to http://www.animationation.net/community/topsites.php
i get this:
Database error in vBulletin 2.3.2:
Invalid SQL: SELECT * FROM topsites_sites WHERE active>0 ORDER BY DESC LIMIT 0,
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 'DESC LIMIT 0,' at line 1
mysql error number: 1064
Date: Wednesday 31st of December 2003 08:14:14 PM
Script: http://www.animationation.net/community/community/topsites.php?page=1&
Referer:
Darkwaltz4
12-31-2003, 05:17 PM
you did not fully fill out your settings, your 'Sites per page' option is not filled out
AN-net
12-31-2003, 05:19 PM
ok just checked phpmyadmin and it doesnt seem it updated anything, from looking at it seems instead of updating you need to insert some stuff so you can browse it. just my 2 cents
Darkwaltz4
12-31-2003, 05:21 PM
okay, in this case, you never executed the INSERT query
if you need it, its:
INSERT INTO `topsites_options` ( `active` , `hitson` , `perpage` , `daytime` , `require` , `buttons` , `totalbuttons` , `resolve` , `display` , `htmlallowed` , `bheight` , `bwidth` , `bborder` , `arrows` , `rankby` )
VALUES (
'0', '0', '10', '1', '1', '', '50', '0', '1', '<b><u><i>', '0', '0', '0', '', 'todayunique'
);
when this is done, thats probably what caused the problem when you tried to update your options :D
AN-net
12-31-2003, 05:22 PM
omg i forgot to do that, silly me lol( got all caught up in actually creating the options table lol
AN-net
12-31-2003, 05:24 PM
To look at anothe working example see:
http://www.animationation.net/community/topsites.php?page=1&
Darkwaltz4
12-31-2003, 05:26 PM
lol, hopefully the next working example wont take as long to get working ^_^
this hack isnt beta, the install instructions were, lol
ill be updating the zip file above soon, there are the movement arrows i forgot to include, and i also revised the instructions a bit, to avoid many of the issues discovered with them :-p
also, newer queries which should work for all mysql versions. hopefully i can add in some of the starred items soon :-p
AN-net
12-31-2003, 05:31 PM
one more problem, ok i signed my own site up to test it and also to see how it works but now, when i get sent the email with the password the password was totally random and weird and also when i copy and pasted it in the site login with my id i got invalid password. is the password susposed to contain subscripts,slashes, and colons?
Darkwaltz4
12-31-2003, 05:34 PM
yeah, i put up a change in the random password generator. *in the new zip* if you would like to change it yourself, find:
chr(rand(1,100));
and change it to chr(rand(1,75));
(this code only appears once, so just use Find)
you can edit the password to your site using the ACP 'manage sites' option
AN-net
12-31-2003, 05:38 PM
yeah, i put up a change in the random password generator. *in the new zip* if you would like to change it yourself, find:
char(rand(1,100));
and change it to char(rand(1,75));
(this code only appears once, so just use Find)
you can edit the password to your site using the ACP 'manage sites' option
what file is that in?
Darkwaltz4
12-31-2003, 05:39 PM
topsites_member.php, sorry >.<
the password generator works with ascii integer codes...so you just have to find a max number that still displays "good" characters
AN-net
12-31-2003, 05:42 PM
just for people who are fixing this, it appears as chr(rand(1,100)); in topsites_member.php
edit:
Fully Operational Topsites at:
http://www.animationation.net/community/topsites.php
feel free to sign up there are no requirements besides no innapropriate/pornographic sites allowd. Thanks and hope everyone enjoys this great hack!
Darkwaltz4
12-31-2003, 06:11 PM
okay, to get the following charset to appear for your passwords (and not have screwwy passwords) use this following code:
find in topsites_member.php:
chr(rand(1,100));
OR
chr(rand(1,75));
REPLACE WITH
chr(rand(32,127));
PRODUCES FROM THE FOLLOWING CHARSET
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
edit, updated zip to reflect change
AN-net
12-31-2003, 06:24 PM
okay, to get the following charset to appear for your passwords (and not have screwwy passwords) use this following code:
find in topsites_member.php:
chr(rand(1,100));
OR
chr(rand(1,75));
REPLACE WITH
chr(rand(32,127));
PRODUCES FROM THE FOLLOWING CHARSET
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
edit, updated zip to reflect change
what does chr(rand(1,75)); produce from?
Darkwaltz4
12-31-2003, 06:27 PM
....a really bad subset :-p whcih was causing problems~
32,127 produces from:
----------------------------
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
and 1,75 produces from:
----------------------------
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK
NOT the best huh? :-p
AN-net
12-31-2003, 08:42 PM
do you plan to make further additions, such as being able to post topsite list stats anywhere on vb?
Darkwaltz4
12-31-2003, 08:44 PM
*shrugs* i could very easily throw together a new function for functions.php, if you told me what you wanted it to show exactly ^_^ probably something like using:
$sitestats = topsite_stats($siteid);
and that would get you the row of stats, for display wherever you call it. (would add extra query to wherever you use it)
Darkwaltz4
12-31-2003, 10:33 PM
okay! i just finished the new whos online locations and updated the zip ^_^ to apply those changes, just use this text file (its included in the new instructions now, but for people who have it installed already...)
AN-net
01-01-2004, 03:25 PM
*shrugs* i could very easily throw together a new function for functions.php, if you told me what you wanted it to show exactly ^_^ probably something like using:
$sitestats = topsite_stats($siteid);
and that would get you the row of stats, for display wherever you call it. (would add extra query to wherever you use it)
like the top 5 sites( including rank #,site name and sitename is a link to the site(will also add to the sites hits/unique hits/in/out)
well thats what i was thinking of or you could make something that scrolls like 5 sites at a time and shows all the stats just not in table form but in row form
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>
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
if ($action=="dooptions") {
$DB_site->query("UPDATE topsites_options SET display='$display',active='$active',require='$requ ire',hitson='$hitson',buttons='$buttons',arrows='$ arrows',perpage='$perpage',totalbuttons='$totalbut tons',daytime='$daytime',htmlallowed='$htmlallowed ',bheight='$bheight',bwidth='$bwidth',bborder='$bb order',resolve='$resolve',rankby='$rankby'");
echo "<p>Options Updated!</p>";
$action = "options";
}
and replace with
if ($action=="dooptions") {
$DB_site->query("UPDATE topsites_options SET display='$display',active='$active','require'='$re quire',hitson='$hitson',buttons='$buttons',arrows= '$arrows',perpage='$perpage',totalbuttons='$totalb uttons',daytime='$daytime',htmlallowed='$htmlallow ed',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>
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:
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:
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:
$today = date("m-d-y");
$maketime = explode("-", $today);
$today = mktime( 0,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)
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',bwidth='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/topsites_admin.php?action=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 ^_^
PixelFx
01-20-2004, 06:49 AM
I'm having issues trying to get this to work, I read all the posts, but still not sure what to do to get this working.
DEMO:
http://www.orbsydia.com/forum/topsites.php
System Info:
Database error in vBulletin Control Panel 2.3.3:
Invalid SQL: UPDATE topsites_options SET display='2',active='1',require='1',hitson='1',butt ons='http://www.orbsydia.com/forum/images/t100btns',arrows='http://www.orbsydia.com/forum/images/t100rank',perpage='25',totalbuttons='5',daytime='1 ',htmlallowed='<b><u><i>',bheight='31',bwidth='88',bborder='0',resolve='1' ,rankby='totalin'
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',buttons='http://www.orbsydia.com/forum/i
mysql error number: 1064
Date: Tuesday 20th of January 2004 04:45:24 AM
Script: http://www.orbsydia.com/forum/forum/admin/topsites_admin.php
Referer: http://www.orbsydia.com/forum/admin/topsites_admin.php?action=options&
Repair Report: This type of error cannot be automatically repaired.
I created this to try and get it working temorally, however if I goto try and change the options I still get the error above.... temp fix below, however I'm still fairly new to mysql/php.
UPDATE `topsites_options` SET `active` = '1',
`hitson` = '1',
`perpage` = '25',
`totalbuttons` = '5',
`resolve` = '1',
`rankby` = 'totalin' WHERE `active` = '0' AND `hitson` = '0' AND `perpage` = '10' AND `daytime` = '1' AND `require` = '1' AND `buttons` = 'http://www.orbsydia.com/forum/images/t100btns' AND `totalbuttons` = '10' AND `resolve` = '0' AND `display` = '2' AND `htmlallowed` = '<b><u><i>' AND `bheight` = '31' AND `bwidth` = '88' AND `bborder` = '0' AND `arrows` = 'http://www.orbsydia.com/forum/images/t100rank' AND `rankby` = 'todayunique' LIMIT 1 ;
I've got a cpanel system... When I try to update info in the ACP, options I get the above error :( .. other than that it looks like a sweet system. I tried the suguested topsites_admin.php update for 1064 error, but doesn't seem to help.
Darkwaltz4
01-20-2004, 08:57 AM
PixelFX I highly suspect you are having the same error as everyone else (which I shall update the files in the next version to reflect this) but in topsites_admin.php, first revert the line which you changed, and instead change
require=
to
`require`=
in all instances where it appears, although it should only be once :). You're just running a newer version of MySQL than I was when I first coded this hack. Like I said, I'll be fixing this permanantly when I post up the next version.
PixelFx
01-20-2004, 10:14 AM
you know I tried that before and it didn't work on my own, when when I tried it now, it worked :P whats up with that :P lol Thanks for help.
DEMO: http://www.orbsydia.com/forum/topsites.php
works great now, .. if I wasn't half awake I'd make 100 buttons for ranking :P
Assault
03-03-2004, 03:52 PM
i am still have'n problems with thjis install
Database error in vBulletin Control Panel 2.3.4:
Invalid SQL: UPDATE topsites_options SET display='1',active='1',require='1',hitson='1',butt ons='http://rapwize.com/forums/topsites/images',arrows='www.rapwize.com/topsites',perpage='25',totalbuttons='3',daytime='1 ',htmlallowed='<b><u><i>',bheight='63',bwidth='63',bborder='0',resolve='1' ,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',buttons='http://rapwize.com/forums/topsi
mysql error number: 1064
Date: Wednesday 03rd of March 2004 12:29:28 PM
Script: http://www.rapwize.com/board/forums/admin/topsites_admin.php
Referer: http://www.rapwize.com/forums/admin/topsites_admin.php?action=options&
PixelFx
03-03-2004, 04:52 PM
This worked well when I had it on vb2, I was wondering if there are any plans to make this for vb3 as well? It's an awesome system...
Darkwaltz4
03-03-2004, 07:33 PM
yeah, same old error
change (everywhere you find it, should only be once)
require=
to
`require`=
to PixelFX:
Im in the process of creating a standalone script which will work independantly of vb, and be even better than aardvark for php topsites :-p i want to become the new norm! :-p
vb3 hacking in general has gone slowly for me >.> as i am still relearning where everything is now
Assault
03-05-2004, 11:34 AM
i don't see it in the topsites_admin.php file can somebody please help me
Assault
03-05-2004, 11:35 AM
and i am getting the same error
Database error in vBulletin Control Panel 2.3.4:
Invalid SQL: UPDATE topsites_options SET display='1',active='1',require='1',hitson='0',butt on s='',arrows='',perpage='10',totalbuttons='50',da ytime='1',htmlallowed='<b><u><i>',bheight='0',bwidth='0', 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='0',button s='',arrows='',perpage='10',tota
mysql error number: 1064
Date: Friday 05th of March 2004 08:36:16 AM
Script: http://www.rapwize.com/board/forums/admin/topsites_admin.php
Referer: http://rapwize.com/forums/admin/topsites_admin.php?action=options&
Darkwaltz4
03-05-2004, 12:03 PM
and i am getting the same error
I know its there and I know its that error:
in topsites_admin.php:
',require='
change to
',`require`='
it appears only once...ill get around to fixing the file eventually >.<
Assault
03-05-2004, 01:06 PM
I know its there and I know its that error:
in topsites_admin.php:
',require='
change to
',`require`='
it appears only once...ill get around to fixing the file eventually >.<
thanx it works
Alien
03-11-2004, 07:30 PM
to PixelFX:
Im in the process of creating a standalone script which will work independantly of vb, and be even better than aardvark for php topsites :-p i want to become the new norm! :-p
vb3 hacking in general has gone slowly for me >.> as i am still relearning where everything is now
Hey. :) I just wanted to offer some words of encouragement.. I looked at the screenshots and this hack is exactly what we're looking for BUT on vB3! I've looked at all the other options and this is the most asthetically pleasing script and the option list, while it could be even more extensive (what hack couldn't?) it fine enough by me... So I really hope you release a version for vB3 (integrating vB database so people don't have to have a seperate name/pass, etc.), we'd love to use this!
Gio~Logist
11-07-2004, 11:30 AM
hey, i am really looking forward to installing this hac k but before i do, is there an extra code i can ad to make it also show a 468x60 banner or sumthing below the site name, like other top sites have it?
Darkwaltz4
11-07-2004, 04:38 PM
you mean to display a banner underneath the header? just add your code in the topsites_mainpage template
on another note, im working on a vb3 version of this hack, very much infused with new features, and it will actually be better than aardvark :) (with import systems from this vb2 version as well as aardvark :-p ) ill probably have it done in a week or so, so be on the lookout if youve wanted vb3 topsites, and your sick of how stupid aardvark is :-p (or something) ^_^
Gio~Logist
11-07-2004, 04:55 PM
no i mean liek this www.urbandynasty.com/forums/toplist.php i am trying to change to your top site hack but i also want it to show the 468x30 banner as well, like shown in that link
Any word on a version of this hack for VB3?
Darkwaltz4
11-09-2004, 09:13 PM
Yes! So glad you asked that :)
I am working, right now, on a version for vb3, its very sexy looking, and is incredibly more powerful that aardvark, in fact I am positive that my new vb3 version will be the most advanced and best designed topsites that has ever been in existance. I've done plenty of homework and I haven't found anything that has come close. I'm not trying to brag exactly, but I really went around and found the best features and put them into one, made them better, and added lots of new stuff, while still having a core topsites system as optimized and as powerful as possible.
Last night I finished up on most of the templates, I'll put up some screenshots of the prototypes if anyone is interested
I'll be done fully with the hack in about a week, keep a sharp look out for this :)
also, i dont think i like a banner thing at the same time as a button thing. if you want banners over buttons, then set the size to be banner sized on the options, and adjust your templates to accommodate the new size if desired. i dont think ill have dual support for the new version either, its just too sloppy, sorry
Koutaru
12-08-2004, 07:59 PM
I'm definately interested :) if you have a beta you'd like to be tested or have updates, please PM me about it! Thanks!
Gio~Logist
12-17-2004, 04:29 PM
Yes! So glad you asked that :)
I am working, right now, on a version for vb3, its very sexy looking, and is incredibly more powerful that aardvark, in fact I am positive that my new vb3 version will be the most advanced and best designed topsites that has ever been in existance. I've done plenty of homework and I haven't found anything that has come close. I'm not trying to brag exactly, but I really went around and found the best features and put them into one, made them better, and added lots of new stuff, while still having a core topsites system as optimized and as powerful as possible.
Last night I finished up on most of the templates, I'll put up some screenshots of the prototypes if anyone is interested
I'll be done fully with the hack in about a week, keep a sharp look out for this :)
also, i dont think i like a banner thing at the same time as a button thing. if you want banners over buttons, then set the size to be banner sized on the options, and adjust your templates to accommodate the new size if desired. i dont think ill have dual support for the new version either, its just too sloppy, sorry
more powerful than aardvark? and its for vb? i gotta see this
Darkwaltz4
12-19-2004, 01:51 PM
its still about halfway done, and nothing has been wrong, its just ive run into another tough time to be coding, with other things taking prescedence. i do plan to work during my christmas break, which will be in a few days, and hopefully thatll give me anough breathing time to finish this...hopefully
i could get you screenshots of whats done if it will help people believe the power and sexiness of it so far :-p
PixelFx
12-20-2004, 01:19 PM
that would be great, I've been dieing to see something like this for vb3+ for a long time.
Koutaru
12-20-2004, 04:37 PM
:D I would love screen shots of its sexiness. Heh heh.
Inzagi
01-03-2005, 11:48 PM
Is there any news about this hack for vb3 ?
Exernon
01-10-2005, 11:13 AM
Database error in vBulletin Control Panel 2.3.5:
Invalid SQL: UPDATE topsites_options SET display='1',active='0','require'='1',hitson='0',bu tton s='http://www.mysite.com/top/gif/',arrows='http://www.mysite.com/top/gif/',perpage='10',totalbuttons='50',da ytime='1',htmlallowed='<b><u><i>',bheight='0',bwidth='0', 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='0',button s='http://www.mysite.com/top/
mysql error number: 1064
Date: Monday 10th of January 2005 07:13:11 AM
Script: http://www.mysite.com/top/top/admin/topsites_admin.php
Referer: http://www.mysite.com/top/admin/topsites_admin.php?action=options&How to fix?
Darkwaltz4
01-16-2005, 12:40 AM
inzagi: ive had no time, sorry, its still at around 50% coded :-/ ill work on it when i can
exernon:
in topsites_admin.php
look for:
--------------
'require'
change to:
--------------
`require`
Hi there
Is there any news on the topsites for VB 3.07 yet ?
thanks :nervous:
Darkwaltz4
04-18-2005, 04:14 AM
Sadly, the project has been indefinately halted due to several reasons..
Im not online much due to internet confiscation/lack of interest
Lack of support for this project as well
Lack of time
and also the confiscation of the laptpo i was working this on, and as far as i know it wasnt deleted, i hope to god it wasnt.
to all of those that are waiting, im sorry, but dont wait, when i do it it probably still wont have anything to rival except aardvark still, which for some reason is all people still use
Koutaru
05-14-2005, 06:37 PM
I'm sorry you've decided to discontinue this, I was really looking forward to something besides Aardvark since it doesn't really promote creativity at all. I hope the code you used will be put to good use at least. Enjoy your time offline!
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.