vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [vB3.0.3]+[vBIndex + Links 1.x] Addon: Tie-in for Links Directory beta and vBIndex (https://vborg.vbsupport.ru/showthread.php?t=61311)

Natch 02-07-2004 10:00 PM

[vB3.0.3]+[vBIndex + Links 1.x] Addon: Tie-in for Links Directory beta and vBIndex
 
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 and the unparalelled vBIndex by NTLDR 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:
Code:

// ####################### 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):
PHP Code:

    $hotlinks = require('forums/get_hotlinks.php'); 

Or (for the one specific category):
PHP Code:

    $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:
PHP Code:

<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$boxsrc="$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$boxstyle="$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:
PHP Code:

<tr>
<
td class="alt1">
<if 
condition="$linkstatus==1">
<
a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkidtarget="_blank">
<
span class="smallfont">$linkname</span></a>
</if>
<if 
condition="$linkstatus>1">
<
a href="$vboptions[bburl]/local_links.php?action=jump&id=$linkidtarget="_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:[sql]ALTER TABLE `local_linkslink` CHANGE `linkhits` `linkhits` MEDIUMINT( 8 ) UNSIGNED DEFAULT '0' NOT NULL;[/sql]

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

Quote:

Originally Posted by Tradjick
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

Quote:

Originally Posted by Natch
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

Quote:

Originally Posted by Hoffi
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:
PHP Code:

require('forums/get_hotlinks.php'); 

REPLACE WITH:
PHP Code:

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

Quote:

Originally Posted by Natch
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:
PHP Code:

require('forums/get_hotlinks.php'); 

REPLACE WITH:
PHP Code:

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

Quote:

Originally Posted by Hoffi
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?


All times are GMT. The time now is 11:40 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.01235 seconds
  • Memory Usage 1,788KB
  • 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_code_printable
  • (8)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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