PDA

View Full Version : [VB3 RC4] [vbAdvanced - Links 1.00] Addon: Latest Links block for vbAdvanced


ixian
03-05-2004, 10:00 PM
UPDATED March 6th:

Whoops. Stupid me forgot to add in a template into the global var adv_index.php uses, as a result there was one uncached template. We don't like those, do we precious.

The instructions to modify adv_index.php have been updated accordingly.

First things first - The majority of the credit for this hack goes to Natch, who did the original version for vbIndex (https://vborg.vbsupport.ru/showthread.php?t=61311). I've converted it over to vbAdvanced, which has a (very) different way of handling custom blocks, and has a different template style as well.

I also took the liberty of modifying Natch's original get_hotlinks_cat.php file so that it orders the list by most recent addition, instead of most popular. You can of course use the original get_hotlinks*.php files from Natches hack if you want to order them that way - those files require no modification to work with this hack.

The attached file includes these instructions and my get_hotlinks_cat_date.php file. Download Natch's hack for the other two files, should you need them.

WHAT THIS HACK DOES:

It combines the Links Directory 1.0 addon created by AndrewD (https://vborg.vbsupport.ru/showthread.php?t=60403) and the vbAdvanced portal by Tigga (https://vborg.vbsupport.ru/showthread.php?t=59803) to give you a "Latest Downloads" block for your vbAdvanced Homepage.


New Files: 1 (3):

get_hotlinks_cat_date.php << To have links/downloads ordered by newest, from specific categories

(The next two files can be used as-is from Natch's original hack, linked above)
get_hotlinks.php << to have top # of all links / downloads
get_hotlinks_cat.php << To have top # from a specific category(s)

Files to Edit: 1
adv_index.php or whatever you renamed it to

New Templates: 2
links_hotlinks
index_linklist

Templates to edit: 1
Index Templates --> index


=============
INSTRUCTIONS:
=============
In adv_index.php (or whatever you have renamed it to):

Find:

'bbcode_quote'


Change To:


'bbcode_quote',
'index_linklist',
'links_hotlinks'



Find:

$custom2 = '';


Add Under:


$linklist = '';

$hotlinks = require('get_hotlinks_cat_date.php'); <!--- or whichever of the 3 files you wish to order the links by --!>


Find:

if ($vboptions['showcustom2'])
{
$getbgrow = getrowcolor();
eval('$custom2 = "' . fetch_template('index_custom2') . '";');
}


Add Under:


eval('$linklist = "' . fetch_template('index_linklist') . '";');




Save and close your adv_index.php file. Upload after you've added the new templates, below.

Upload the file get_hotlinks_cat_date.php or Natch's original files get_hotlinks.php and get_hotlinks_cat.php if you are using one of them instead to your forumhome folder

NOTE: if you want more than 5 links listed, please edit the $limit variable at the top of those files.
NOTE: If you are using the standard Links 1.0 TABLE PREFIX or the VB table prefix, make the appropraite alrterations @ the top of your new files as well


Create a new template called links_hotlinks and populate it with:
<tr>
<td class="alt1">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_new">
<span class="smallfont">$linkname</span></a>
<else />
<span class="smallfont">$linkname (not available)</span></a>
</if>
</td>
</tr>


OR, if you are using Natch's original get_hotlinks*.php files and want to order them by hits, use this instead so you get a hit count column:


<tr>
<td class="alt1">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_new">
<span class="smallfont">$linkname</span></a>
<else />
<span class="smallfont">$linkname (not available)</span></a>
</if>
</td>
<td class="alt2" align="right">
<span class="smallfont">$linkhits</span>
</span>
</td>
</tr>


Create a new template called index_linklist and populate it with:


<!-- Latest Links -->
<table align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">
<tr>
<td align="$stylevar[left]" class="tcat">
<span class="smallfont"><b>$vboptions[blockbullet] Latest Downloads:</b></span>
<tr>
<tr><td class="alt2">
$hotlinks
</td></tr>
</table>
<br>
<!-- End Latest Links -->


Edit Index Templates -> index and add the following

$linklist


Wherever you want the hotlinks box to show up (I put it under $custom2 myself; just search for that in your index template if you want a starting point).


Thanks once again to Natch for the original hack, AndrewD for the Links hack in the first place, and of course Tigga for vbAdvanced.

Kwak
03-06-2004, 08:02 PM
Awesome job man! I am going to get this installed sometime next week. :cool:

msimplay
03-14-2004, 09:27 PM
great hack very pleased with it :D

Arkham
03-16-2004, 02:49 PM
Can this also list a brief description with each link? IE take the first X number of characters from the full description? How hard would that be to add, if it's not already possible?

ixian
03-16-2004, 05:12 PM
Can this also list a brief description with each link? IE take the first X number of characters from the full description? How hard would that be to add, if it's not already possible?

With php just about anything is possible - if it's in the database, you can pull it out and display it wherever you want.

The problem with this approach is you wouldn't be able to fit that many characters in the block without it looking extremely cluttered, and "snipping" the text from the main description, while very do-able, means you would have to cram as much info as possible in the first 10 or so characters - not very elegant.

A better way would be to have a short "description" field in addition to the regular description in the Links/File hack itself. I'm actually working on a mod for it - I am adding an "listing" page for files and links so you can display a lot more of them in a more organized fashion. The listing page will then take you to a page that's just for that file/link, where it makes more sense to add much longer descriptions, screen shots, etc. The "listing" page will have the new short description field I am talking about.

Once that is done (I will post it here in the addons section) it will be trivial to add a var that pulls the simple description and displays it in the block.

Arkham
03-16-2004, 07:22 PM
With php just about anything is possible - if it's in the database, you can pull it out and display it wherever you want.

The problem with this approach is you wouldn't be able to fit that many characters in the block without it looking extremely cluttered, and "snipping" the text from the main description, while very do-able, means you would have to cram as much info as possible in the first 10 or so characters - not very elegant.

A better way would be to have a short "description" field in addition to the regular description in the Links/File hack itself. I'm actually working on a mod for it - I am adding an "listing" page for files and links so you can display a lot more of them in a more organized fashion. The listing page will then take you to a page that's just for that file/link, where it makes more sense to add much longer descriptions, screen shots, etc. The "listing" page will have the new short description field I am talking about.

Once that is done (I will post it here in the addons section) it will be trivial to add a var that pulls the simple description and displays it in the block.

Thanks, looks like you're working on exactly what I need. I wasn't intending to cram it all in a small box, but I needed to know if this would be possible in the current or future version.

I appreciate your quick response. That's one more check in the plus-column for vBadvanced. I've pretty much decided that will be my next step.

Cheers.

SB2002
03-21-2004, 01:23 PM
I've hacked and rehacked this now several times, but everytime i do the table on vba is never populated. It just shows the header and that is all. I don't know why, because everything is hacked correctly :(

I've just checked again, seems that no one can make a hack truely idiot proof :)

As the saying goes read the f**king manual :D

Lionel
03-22-2004, 02:08 AM
I got it install no problem on the gold release, it is just the $linkhits that does not display on VB_advanced page. I get []. All permissions are set and it does display on main page.

FleaBag
03-28-2004, 05:22 PM
Sweet ass, just installed this. Thanks.

milkmycow
04-02-2004, 06:57 PM
question, how do you specify the catagory to pull from?

ixian
04-07-2004, 06:45 PM
question, how do you specify the catagory to pull from?

Use my get_hotlinks_cat_date.php or the get_hotlinks_cat.php that comes with the hack - they both have a string near the top where you can edit the category numbers you want to use.

Morrus
04-08-2004, 05:02 AM
I got it install no problem on the gold release, it is just the $linkhits that does not display on VB_advanced page. I get []. All permissions are set and it does display on main page.

Same problem here. It started when I upgraded to Links Directory 1.01, so maybe there's a change in the original links hack which affects this one?

ixian
04-14-2004, 03:54 PM
I am taking a look at the links changes now. They probably just changed a variable.

ixian
04-20-2004, 01:36 PM
I've updated the files in this hack to reflect some minor fixes. This works perfectly for me with vb 3.0.1/Links 1.10 now.

r00t3d
04-24-2004, 07:42 PM
any way to display the number of downloads and file size in the latest download block?

msimplay
04-24-2004, 09:17 PM
any way to display the number of downloads and file size in the latest download block?
yeh that would be a good idea

r00t3d
05-04-2004, 10:35 AM
anybody?

XPsave
05-11-2004, 02:51 AM
Hmmz, very new to vbulletin, infact about a day in. ive installed the advanced portal, and downloads & links hack 1.21, and just now tried to install your hack, im not sure what ive done wrong... so ill post up my stuff in the hopes someone will see something silly :)

first off:
i have,
get_hotlinks_cat_date.php
get_hotlinks.php
get_hotlinks_cat.php
in www.mydomain.com/forums/
and index.php (adv_index.php) in www.mydomain.com

then,
i made all the changes to index.php (odly enough i got returned an error about an unexpected < , removing a comment fixed it <!--- or whichever of the 3 files you wish to order the links by --!> )

next goto links_hotlinks
<tr>
<td class="alt1"><span class="smallfont">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">$linkname</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">
$linkname (not available)
</if>
</span>
</td>
<td class="alt2">
<span class="smallfont">[$linkhits]</span>
</td>
</tr>
Not exactly sure what the other code is, but i suspect it to be a new feature in the links hack

next index_linklist

<table align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">
<tr>
<td align="$stylevar[left]" class="tcat">
<span class="smallfont"><b>$vboptions[blockbullet] Latest Downloads:</b></span>
<tr>
<tr><td class="alt2">
$hotlinks
</td></tr>
</table>
<br>


then modded the index template as stated.

put it all together and i get a block or rather the header to a block but no content, ive linked a file to see if it will appear, but still no list

im stuck anyone have any ideas?

mariannet
08-25-2004, 06:33 PM
Hmmz, very new to vbulletin, infact about a day in. ive installed the advanced portal, and downloads & links hack 1.21, and just now tried to install your hack, im not sure what ive done wrong... so ill post up my stuff in the hopes someone will see something silly :)

first off:
i have,
get_hotlinks_cat_date.php
get_hotlinks.php
get_hotlinks_cat.php
in www.mydomain.com/forums/
and index.php (adv_index.php) in www.mydomain.com

then,
i made all the changes to index.php (odly enough i got returned an error about an unexpected < , removing a comment fixed it <!--- or whichever of the 3 files you wish to order the links by --!> )

next goto links_hotlinks
<tr>
<td class="alt1"><span class="smallfont">
<if condition="$linkstatus==1">
<a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkid" target="_blank">$linkname</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">
$linkname (not available)
</if>
</span>
</td>
<td class="alt2">
<span class="smallfont">[$linkhits]</span>
</td>
</tr>
Not exactly sure what the other code is, but i suspect it to be a new feature in the links hack

next index_linklist

<table align="center" border="0" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" width="100%">
<tr>
<td align="$stylevar[left]" class="tcat">
<span class="smallfont"><b>$vboptions[blockbullet] Latest Downloads:</b></span>
<tr>
<tr><td class="alt2">
$hotlinks
</td></tr>
</table>
<br>


then modded the index template as stated.

put it all together and i get a block or rather the header to a block but no content, ive linked a file to see if it will appear, but still no list

im stuck anyone have any ideas?
Bump on this one, I get the same empty box?

yoyoyoyo
01-29-2005, 04:38 PM
is this being supported anymore?

ptmuldoon
02-17-2005, 05:49 PM
Can anyone tell me what index file needs to be edited? I can't seem to find the adv_index file, nor can I seem to find any of the code thats being referenced in the install instructions in any of my existing index files.

ixian
02-25-2005, 05:20 AM
I just wanted to update to say this hack is no longer supported, and in fact is quite old. I mention this because several folks are under the impression that this is not the case; I apologize. I no longer use vbAdvanced although I still think it is a very good addon.

I highly recommend heading over to www.vbadvanced.com and checking out their addons section for something similar in functionality to this one, or finding help.