View Full Version : [vB3.0.3]+[vBIndex + Links 1.x] Addon: Tie-in for Links Directory beta and vBIndex
Natch
02-07-2004, 10:00 PM
NOTE: this has been integrated into the Links Directory hack - this version will noit be kept up to date!
WHAT THIS DOES:
It combines the excellent Links Directory 0.95 beta created by AndrewD (https://vborg.vbsupport.ru/showthread.php?t=60403) and the unparalelled vBIndex by NTLDR (https://vborg.vbsupport.ru/showthread.php?t=59524) to give you a "Hottest Downloads" customblock for your vBIndex powered homepage.
New Files: 2
forumhome/get_hotlinks.php << to have top # of all links / downloads
forumhome/get_hotlinks_cat.php << To have top # from one specific category
Files to Edit: 1
vbindex.php or whatever you renamed it to
DEPRECATED @1.00 - THIS TEMPLATE NOW INCLUDED IN THE LINKS HACK
New Templates: 1
links_hotlinks
Templates to edit: 1
vbindex_customblock_1 or whatever your first free customblock is
DEPRECATED @0.95 THIS QUERY NO LONGER NEEDED
SQL Queries to run: 1
This is simply to alter a field from "TEXT" to "MEDIUMINT(8)" for storing the hit-tracker
=============
INSTRUCTIONS:
=============
In vbindex.php (or whatever you have renamed it):
Find:
// ####################### GENERATE SIDE BAR ##########################
// ## CUSTOM BLOCKS
if (!empty($vbindex['customboxes'])) {
Add After: (if your forums are not in the "forums" directory, you will need to alter this.
Either (for the original style):
$hotlinks = require('forums/get_hotlinks.php');
Or (for the one specific category):
$hotlinks = require('forums/get_hotlinks_cat.php');
Upload the files get_hotlinks.php and get_hotlinks_cat.php to your forumhome folder
NOTE: if you want more than 5 links listed, please edit the $limit variable at the top of this file.
NOTE: If you are using the standard 0.95 TABLE PREFIX or the VB table prefix, make the appropraite alrterations @ the top of your new files
Edit vbindex_customblock_1 (or your chosen customblock) to match the contents of the text file in the attachment
Contents here for the hell of it:<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%">
<tr>
<td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td colspan="2" class="tcat" style="text-align: center">
<a name="hotties" style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$box" src="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a>
<strong><a href="$vboptions[bburl]/local_links.php" title="Visit the Downloads section">Hottest Downloads</a></strong>
</td>
</tr>
<tbody id="collapseobj_vbindex_customblock$box" style="$collapseobj_vbindex_customblock">
$hotlinks
</tbody>
</table>
</td>
</tr>
</table>
<br />
DEPRECATED @1.00 - THIS TEMPLATE NOW INCLUDED IN THE LINKS HACK
Create a new template called links_hotlinks and populate it with the contents of the text file in the attachment
Contents here for the hell of it:<tr>
<td class="alt1">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">
<span class="smallfont">$linkname</span></a>
</if>
<if condition="$linkstatus>1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">$linkname</a> [size: $linkstatus kb]
</if>
<if condition="$linkstatus<=0">
<span class="smallfont">$linkname (not available)</span></a>
</if>
</td>
<td class="alt2">
<span class="smallfont">[$linkhits]</span>
</span>
</td>
</tr>
DEPRECATED - IF YOU HAVE INSTALLED 0.95, THIS IS NO LONGER NECESSARY
Run the query that is contained in the SQL_QUERY.txt file in the attachment
Contents here for the hell of it:ALTER TABLE `local_linkslink` CHANGE `linkhits` `linkhits` MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL;
UPDATED 25-02-2004:
Fixed a bug pointed out by Hoffi in the category specific file which caused multimples to appear - both files now use a DISTINCT select for the query.
Enjoy y'all :)
! MAKE SURE YOU HAVE THE LATEST VERSIONS OF BOTH INSTALLED !
Tradjick
02-10-2004, 07:07 AM
Could you be more clear on changing the vbindex.php cause i always get a parse error.
But even without this chang, it works! Thanks for this addon.
I got one more question... would it be possible that the shoutbox and the vbcustomblock2 would keep their position after changing into the linksdirectory?
PixelFx
02-10-2004, 08:04 AM
can you add support for vb advanced as well please :)
Natch
02-10-2004, 08:46 AM
I dont use and never thought of using vBAdvanced (I only have one forum to work with, and I use vBIndex) - but if it uses custom blocks in the same way as vBIndex, then the template should be easily modifiable ...
Other than the template, the other changes are the same ...
With regards adding the support for the vbadvanced index.php (main homepage) you would need to find the section of that script that deals with the custom blocks, and then add the include statement in that part of the script (so that it only gets included if you have an active customblock) ...
Feel free to email me a copy of a vBAdvanced customblock, and a copy of the index.php for vbadvanced and I'll take a look @ it for ya ...
Natch
02-10-2004, 08:50 AM
Could you be more clear on changing the vbindex.php cause i always get a parse error.
But even without this chang, it works! Thanks for this addon.
I got one more question... would it be possible that the shoutbox and the vbcustomblock2 would keep their position after changing into the linksdirectory?
Mate - I'm not sure how much clearer I can be - feel free to PM me about it and I'll take a look @ your vbindex.php file...
Hoffi
02-13-2004, 09:41 PM
Mate - I'm not sure how much clearer I can be - feel free to PM me about it and I'll take a look @ your vbindex.php file...
Hi,
thats good! But I use the Database for Links and Downloads and have two Main Categories. Can I easy modify it to only have the Downloads (And/or) Links. It's not very good to mix them up. :(
Natch
02-14-2004, 12:57 AM
Hi,
thats good! But I use the Database for Links and Downloads and have two Main Categories. Can I easy modify it to only have the Downloads (And/or) Links. It's not very good to mix them up. :(
Yeah it's possible; its easier if YOU have specifically separated Links and Downloads into different categories: if so, we can change the structure of the query to get items from only one category ... the query becomes more complex, so what I'll do is create a different file to use for the include and get you to test it ok ?
After installing vBIndex, the Links directory and my addon, do the following to Limit to specified Categories:
Find in vbindex.php:
require('forums/get_hotlinks.php');
REPLACE WITH:
require('forums/get_hotlinks_cat.php');
Get the new file attached to this post and edit the variable at the top $cats to match the category ids you wanna include in teh hotlinks list.
Hoffi
02-15-2004, 12:50 PM
Yeah it's possible; its easier if YOU have specifically separated Links and Downloads into different categories: if so, we can change the structure of the query to get items from only one category ... the query becomes more complex, so what I'll do is create a different file to use for the include and get you to test it ok ?
After installing vBIndex, the Links directory and my addon, do the following to Limit to specified Categories:
Find in vbindex.php:
require('forums/get_hotlinks.php');
REPLACE WITH:
require('forums/get_hotlinks_cat.php');
Get the new file attached to this post and edit the variable at the top $cats to match the category ids you wanna include in teh hotlinks list.
yeah, taht works. Thanks. And with a copy named get_hotlinks_link.php I did another Box for Hot Downloads.
Natch
02-15-2004, 08:28 PM
yeah, taht works. Thanks. And with a copy named get_hotlinks_link.php I did another Box for Hot Downloads.
Groovy :) glad that worked :) :)
gmarik
02-17-2004, 02:00 PM
Could it be:
1) Downloads
2) Links
a?
Natch
02-17-2004, 02:09 PM
Could it be:
1) Downloads
2) Links
a?
Explain your question (and not just the a? bit) ?
Tradjick
02-17-2004, 05:48 PM
It does'nt have to do something about your hack but why do I get:
You are not authorized to execute SQL queries
???
Tradjick
02-17-2004, 07:08 PM
i ran the query in phpmyadmin and now i get this as an error on index.php:
Database error in vBulletin 3.0.0 Release Candidate 4:
Invalid SQL:
SELECT link.linkid AS linkid, link.linkname AS linkname, link.linkdesc AS linkdesc,
link.linkhits AS linkhits, link.linkstatus AS linkstatus
FROM vb3_local_linkslink AS link
ORDER BY linkhits DESC
LIMIT 5
mysql error: Table 'vbullet.vb3_local_linkslink' doesn't exist
mysql error number: 1146
Date: Tuesday 17th of February 2004 10:04:06 PM
Script: http://localhost/index.php?
Referer: http://localhost/forum/index.php?
Username: Abrel_Knezquawr
IP Address: 127.0.0.1
Any ideas on this?
Tradjick
02-17-2004, 07:21 PM
maybe it's because i did this with the new 0.95 version from AndrewD???
edit: now that i deleted that require line from vbindex.php everything works fine.
Natch
02-17-2004, 09:27 PM
I haven't modified this to test it with v0.95 yet ... but the SQL query may have had problems if you were running it after v0.3 as v0.3 didn't require you to run that step (the instructions in the upgrade to 0.3 from AndrewD were pretty clear on that...)
Natch
02-22-2004, 05:51 AM
The new version upgrade tool from AndrewD deleted the template - so you will need to re-add the template "links_hotlinks" - after doing that, the addon WILL WORK :)
gmarik
02-22-2004, 06:13 AM
Not only show the latest downloads (with some more meta data, not only the name, also the filesize and date atleast), but a link catalogue as well. Got it?
Natch
02-22-2004, 06:34 AM
Not only show the latest downloads (with some more meta data, not only the name, also the filesize and date atleast), but a link catalogue as well. Got it?
OMFG gmarik : I have seen a lot of posts by you (or someone using your account), and they are all rude and close to being insulting ...
If you are not going to participate by either writing or supporting hacks, or by providing helpful and constructive criticism, BACK OFF and let us do our work ... (unless you are gonna pay $$$, in which case you can be as rude as you like) ...
Got it ?
gmarik
02-22-2004, 07:18 AM
Why rude? I'm just expressing short my idea and I do will release my hacks, when the Gold comes out ...
Hoffi
02-25-2004, 04:44 AM
Why rude? I'm just expressing short my idea and I do will release my hacks, when the Gold comes out ...
It works with the actual Version.
There is a small Bug in the Category Version. If a Link/Download is in two Categories It will show twice in the Box. Just Add a distinct in the SELECT clause.
Natch
02-25-2004, 05:39 AM
It works with the actual Version.
There is a small Bug in the Category Version. If a Link/Download is in two Categories It will show twice in the Box. Just Add a distinct in the SELECT clause.
Thx Hoffi :) I'll rectify the original post to include both versions and instructions on how to use them ....
Natch
02-25-2004, 05:52 AM
This hack updated @ 25-02: upgrade to 0.95 - the only thing you need to do is re-upload the get_hotlinks.php and/or get_hotlinks_cat.php files, and re-add the links_hotlinks template :) and you should be back up and running ...
Natch
03-03-2004, 06:50 AM
Should work just fine with V1.00 :) thanks to AndrewD for the inttegration of the hotlinks template :)
achtungbaby
03-04-2004, 02:44 AM
thumbs up
ixian
03-06-2004, 06:47 PM
Natch,
I converted this over to vbAdvanced, and also added an option to order the lists by latest date rather than number of hits.
It's rather large, so I'll post it separately, with all credit to you of course. Please let me know if you mind me doing this.
refertech
03-07-2004, 09:20 PM
Can someone help to tell me what i did wrong. I keep getting the following error.
Warning: main(forum/get_hotlinks.php): failed to open stream: No such file or directory in /home/plmtech/public_html/forum/vbindex.php on line 1040
Fatal error: main(): Failed opening required 'forum/get_hotlinks.php' (include_path='/usr/local/lib/php:.') in /home/plmtech/public_html/forum/vbindex.php on line 1040
ixian
03-07-2004, 09:57 PM
Can someone help to tell me what i did wrong. I keep getting the following error.
Warning: main(forum/get_hotlinks.php): failed to open stream: No such file or directory in /home/plmtech/public_html/forum/vbindex.php on line 1040
Fatal error: main(): Failed opening required 'forum/get_hotlinks.php' (include_path='/usr/local/lib/php:.') in /home/plmtech/public_html/forum/vbindex.php on line 1040
Looks like you got the path to get_hotlinks.php wrong - you have it as "forum" where it should be the full path to the forum directory.
refertech
03-07-2004, 10:43 PM
Yea, I'm silly. I got it.
Thanks for your help thou.
But for some reason 3 of the links are showing not available but I know they are good cause they work fine in my links section. Anyone got any ideas why 2 of them work and the last 3 dont. I'm scratching my head.
Thanks.
Mark
refertech
03-09-2004, 07:03 PM
But for some reason 3 of the links are showing not available but I know they are good cause they work fine in my links section. Anyone got any ideas why 2 of them work and the last 3 dont. I'm scratching my head.
Mark
Any one got any ideas on this one yet?
Thanks,
Mark
Natch
03-09-2004, 07:39 PM
Check this one out with the author of the Links hack ... AndrerwD supports his hack - I'm not as up-to-speed with how his hack works to support it fully ....
marandb
03-11-2004, 06:56 AM
Ok, I am having problems, I am getting this error:
Fatal error: Failed opening required 'forum/get_hotlinks.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/brik/public_html/forum/index.php on line 1041
The "get_hotlinks.php" file is in the forum directory. I know that the "/home/brik/public_html/forum/" is the proper CHDIR_PATH.
What is going on? If I was to try to put the full http path I get another error.
Can someone help??? Please.
Right now the site is up, but there is NO hot downloads counts. (Because I took the refering line out of index.php)
www.brikbattles.com/forum
Thanks,
-- Marand
Natch
03-11-2004, 07:07 AM
The only reason why this would not work is a) the file is not there or b) you have modified the file so that it returns errors ...
Please ensure you have both the vBIndex installed properly and the Links Directory installed properly ...
AndrewD
03-11-2004, 04:07 PM
Any one got any ideas on this one yet?
Thanks,
Mark
Sorted...
Anyone who installed this hack and then installed an updated version of the basic Links and Files Database hack is likely to face the same problem.
Update your links_hotlinks template to the latest version to take into account the fact that Links and Files now tracks file sizes for local downloads.
Please use the attachment as your example.
This corrected template was included in the main Links and Files Download but may have escaped attention here.
refertech
03-11-2004, 06:32 PM
Cool. Thanks man.
Mark
Natch
03-11-2004, 07:06 PM
Updated post #1 with instructions to ensure everyone installs latest versions of the host hacks before this one will work.
It wasn't overlooked - unfortunately as this is not a "hack" but an addon, the vb.org admins decided that we don't get to provide 'updates' to the users of the hack ...
marandb
03-17-2004, 05:36 AM
Hmmm..
Okay, I am getting a # above the title of the custom box (= the custom box #) and the Hottest Downloads doesn't seem to be working at all.
Can anyone help.
www.brikbattles.com
Thanks alot.
-- Marand
marandb
03-19-2004, 03:16 AM
Hmmm.... Anyone?
I still have the custom box # displaying above the Title bar & the box will NOT display any downloads???
Can someone help? :ermm:
Thanks
-- Marand
Natch
03-19-2004, 06:13 AM
Can I suggest that you paste in a [code] block here the contents of your local_hotlinks template ... that for a start ...
marandb
03-19-2004, 02:23 PM
Sure, no prob....
local_hotlinks template:
<tr>
<td class="alt1">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">
<span class="smallfont">$linkname</span></a>
</if>
<if condition="$linkstatus>1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">$linkname</a> [size: $linkstatus kb]
</if>
<if condition="$linkstatus<=0">
<span class="smallfont">$linkname (not available)</span></a>
</if>
</td>
<td class="alt2">
<span class="smallfont">[$linkhits]</span>
</span>
</td>
</tr>
Should be exaclty as listed on the first post.
Thanks alot for any help.
-- Marand
Natch
03-19-2004, 10:34 PM
Sorry - what I actually need is the customblock template - sorry ...
Sure, no prob....
local_hotlinks template:
<tr>
<td class="alt1">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">
<span class="smallfont">$linkname</span></a>
</if>
<if condition="$linkstatus>1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">$linkname</a> [size: $linkstatus kb]
</if>
<if condition="$linkstatus<=0">
<span class="smallfont">$linkname (not available)</span></a>
</if>
</td>
<td class="alt2">
<span class="smallfont">[$linkhits]</span>
</span>
</td>
</tr>
Should be exaclty as listed on the first post.
Thanks alot for any help.
-- Marand
Lionel
03-21-2004, 02:43 AM
I got it install no problem on the gold release, it is just the $linkhits that does not display on advanced page. I get []. All permissions are set and it does display on main page.
Natch
03-21-2004, 09:23 AM
I got it install no problem on the gold release, it is just the $linkhits that does not display on advanced page. I get []. All permissions are set and it does display on main page.
You mean on vBAdvanced ?
Lionel
03-21-2004, 05:25 PM
yes vbadvanced
marandb
03-21-2004, 07:01 PM
vbindex_customblock_1 (template used)
<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%">
<tr>
<td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td colspan="2" class="tcat" style="text-align: center">
<a name="hotties" style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$box" src="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a>
<strong><a href="$vboptions[bburl]/local_links.php" title="Visit the Downloads section">Hottest Downloads</a></strong>
</td>
</tr>
<tbody id="collapseobj_vbindex_customblock$box" style="$collapseobj_vbindex_customblock">
$hotlinks
</tbody>
</table>
</td>
</tr>
</table>
<br />
Thanks,
-- Marand
Natch
03-21-2004, 08:18 PM
yes vbadvanced
Lionel - this is the hack that ties in with vBIndex, not vBAdvanced - there is a very different hack that works with vBAdvanced ...
Natch
03-21-2004, 08:25 PM
vbindex_customblock_1 (template used)
<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%">
<tr>
<td>
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td colspan="2" class="tcat" style="text-align: center">
<a name="hotties" style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$box" src="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a>
<strong><a href="$vboptions[bburl]/local_links.php" title="Visit the Downloads section">Hottest Downloads</a></strong>
</td>
</tr>
<tbody id="collapseobj_vbindex_customblock$box" style="$collapseobj_vbindex_customblock">
$hotlinks
</tbody>
</table>
</td>
</tr>
</table>
<br />
Thanks,
-- Marand
It seems that you have some problems with your copy of the get_hotlinks.php file ... the value of the variable is "1", not the list of links ...
Can you confirm that you are using the latest versions of the get_hotlinks.php file ?
marandb
03-22-2004, 01:54 AM
Hmm.... Just uploaded the newest (downloaded from the first post in this thread) get_hotlinks.php file. Haven't seen a newer one than that.
Still the same result.
The # above the title bar (Hottest Downloads) is the Custom Block #. Example: changes to 2 is I use Custom Block 2.
Thanks again,
Any help is appreciated. Would be REALLY nice to get this up & running soon.
-- Marand
Lionel
03-22-2004, 02:03 AM
Lionel - this is the hack that ties in with vBIndex, not vBAdvanced - there is a very different hack that works with vBAdvanced ...
Ouch, I got confused by the mention of your name on the other hack.
hopester
04-18-2004, 03:33 PM
Was there any fix for the problem Marand had above as I have exactly the same problem?
Thanks
Natch
04-18-2004, 09:03 PM
Are you running the latest version of the Links DB ?
hopester
04-18-2004, 09:12 PM
1.10 for links and 1.00 for your addon. I just get the number of the custom block above the hottest downloads label in the displayed block. I've tried the get_hotlinks.php from your mod and the one Andrew includes with his download.
Natch
04-18-2004, 09:29 PM
I'll get back to you on this one - (sorry for the delays then MarandB)
marandb
04-19-2004, 04:16 PM
Thanks alot, any help is appreciated
-- Marand
Natch
04-23-2004, 03:55 PM
Can I see some links to the problem again ? I'm stumped on why this might be happening ? The only thing I can think of is maybe a config issue on the server - which means my code is not portable enuff ...
Lemme know those who were having trouble ...
marandb
04-23-2004, 04:22 PM
<a href="http://www.brikbattles.com" target="_blank">www.brikbattles.com</a>
-- Ramus
hopester
04-23-2004, 08:04 PM
Only thing I noticed today was my crappy host (webfusion) is using php 4.1.2 so I tried installing on a later version on a friends server (4.3.2) and it worked fine. Whether 4.1.2 is a problem or the server config is I dont know.
Hope this helps.
Natch
04-24-2004, 12:16 AM
Thanks - that could well be the issue - could you both also post your MySQL version as well ...
hopester
04-24-2004, 09:25 AM
3.23.56 - I used the same mysql server for both installs.
Natch
04-24-2004, 10:40 AM
Hmmm - I thought it might be related to an early version of one or both of those -= I'll look into it further ...
marandb
04-26-2004, 04:16 PM
PHP version 4.2.3
MySQL version 4.0.18-standard
-- Marand
Natch
04-29-2004, 03:55 AM
On looking into it further, it looks unlikely to be related to php version or sql version ...
If you have tried uninstalling both hacks, then reinstalling from scratch, please let me know and I'll get access details to take a look @ your files / templates.
I know this is taking some time to get resolved, but there is no simple answer ..
T3MEDIA
12-18-2004, 12:24 PM
What exactly does this do? A download page linker?
Not sure what this does completely.
AndrewD
12-19-2004, 08:07 AM
What exactly does this do? A download page linker?
Not sure what this does completely.
The Links/Files database in the Major Additions provides a full system for handling file downloads + web links database. This provides an interface between that hack and VBindex. It is now integrated into Links/Files
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.