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)
-   -   Links and Files Database (https://vborg.vbsupport.ru/showthread.php?t=60403)

AndrewD 01-17-2004 10:00 PM

Links and Files Database
 
The VB3.0 version is no longer supported although there have been no reported problems for some time

See here for the VB 3.6 version of this hack, which is now the supported version. This version currently also works with VB 3.5
See here for the VB 3.5 thread for this hack.

What's new in v1.60?

Option to display associated thumbnail images
Option to accept/not accept new entries if these already exists in database
Code for mass edits (accessed via admincp) tidied up
VB phrasing completed
Includes a full French and a partial German translation (thanks to cclaerhout, Allan and LeeWicKeD), handled properly by installation script.
Various bugs fixed and tested against php4 and php5:
Better database validation (on startup/in admincp: links with invalid associated forumids, categories with invalid parentids)
Alternative linkbit templates provided (default uses a fieldset, the other is the old-style table row)
Alternative category selection templates (pull down menu/list of checkboxes),
Star rating displayed using standard VB stars rather than in text form
Series of minor bug fixes
See file change.txt in zip file

What it is/does

- Provides a searchable database of weblinks and/or downloadable files, for example manuals, music files, pictures, etc.
- Integrates within VBulletin, without requiring any code changes.
- Transparently handles links and file downloads. (If you want to provide downloads from your own site, you need a separate tool to upload these files. This hack does not and will not include a file uploader.)
- Provides unlimited nested categories.
- Each link/file can be a member of multiple categories.
- Link and category title and descriptions can use all BBCODEs, giving the possibility to add images, colouring, etc, as you wish
- Viewing/access permissions controlled using VBulletin forum system
- Users can rate links, in a similar manner to VB thread rating.
- File downloads are semi-leechproof, i.e. the user does not see where the file is stored and can only access the link if she has access to the associated forum.
- Audio files playable via Windows Media Player can be offered as a jukebox .
- Tracks who downloads what
- Validates links on entry/editing, and provides admin facility to validate the entire database.

Installation/upgrading instructions

Read instructions.txt in the zip file. Installation script works out whether to install or upgrade.

To upgrade from an earlier release of this hack, simply re-run the installation script. If you modified the templates in the top styles, you will lose these modifications unless you back up and re-edit.

PLEASE BACK UP YOUR DATABASE

See also

For screen shots, see attachments.

Tested with

VBulletin 3.0 and higher
PHP 4.1.1 and 4.3.4, should work with all 4.x versions, seems ok with 5.0.4
MySQL 4.0.
Reported ok with MySQL 4.1 but not exhaustively tested

Credits

Initially inspired by drkFusion's vb2 hack "vb Link Directory" v.2 and discussion about v.3 on Vbulletin.org. This is a complete rewrite with many more features. Every credit to the VBulletin folks for providing the infrastructure and to those on vbulletin.org who have helped with testing.

Integrations/Conversions

Natch has written extensions to integrate this hack with VBindex and VBAdvanced.

For convenience, this hack includes fully integrates with, but does not install, his VBIndex hack - i.e. the required template and code are provided, and the admin panel handles the configuration settings. Please refer to his thread for instructions.

Integration with VBadvanced is described in thread 1319 at vbadvanced.com.

The zip file includes a script and instructions for converting from vbLinks v2 (see thread 44551

tomshawk 01-18-2004 04:16 PM

Sounds like something I could use, Got any screenshots?

gmarik 01-18-2004 05:09 PM

This is what we needed. Several things:
- not integrated with the admin cp is no good - you need to integrate it, it's the most important part
- we could make the design together - and we could cooperate with other download zone vb2 hackers to unite the code and make it even better.

dede1 01-18-2004 06:10 PM

Error comes with me if I one left to insert wants:

Quote:

Database error in vBulletin 3.0.0 Release Candidate 2:
Invalid SQL:
INSERT INTO local_linkslink (linkname, linkurl, linkdesc, linkimage, hits, linkforum, linkcheck, linkstatus)
VALUES (
'Dede1',
'http://www.dede1.de',
'test test',
'http://63.246.136.220/Board/images/misc/vbulletin3_logo_white.gif',
0,
'9',
1074456318,
0
)

mysql error: Unknown column 'linkcheck' in 'field list'
mysql error number: 1054
Date: Sunday 18th of January 2004 03:05:58 PM
Script: http://63.246.136.220/Board/local_links.php
Referer: http://63.246.136.220/Board/local_li...dlink&catid=-1
Username: Dede1
IP Address: xxxxxxxxxxxxxx

Nmidia 01-18-2004 06:16 PM

Quote:

Originally Posted by dede1
Error comes with me if I one left to insert wants:

I get this when I try and run the queries. I'm using RC1. Is it incompatible?

An error occurred while attempting to execute your query. The following information was returned.
error number: 1064
error desc: You have an error in your SQL syntax near ';
CREATE TABLE local_linkscat (
catid smallint(5) NOT NULL auto_increment,
' at line 1

AndrewD 01-18-2004 06:17 PM

Quote:

Originally Posted by dede1
Error comes with me if I one left to insert wants:

fixed, answer no longer relevant

gmarik 01-18-2004 06:22 PM

You should add:
- admin / moderator {editor} link rating (5 stars)
- links out
- links in page
- total statistics

Nmidia 01-18-2004 06:28 PM

Quote:

Originally Posted by gmarik
You should add:
- admin / moderator {editor} link rating (5 stars)
- links out
- links in page
- total statistics

Also would be good to add a way of iconising the fact that you have categories. So cats have an icon, links have their own icon

Nmidia 01-18-2004 06:29 PM

Quote:

Originally Posted by AndrewD
sorry - try downloading the zip again or use the definition below - I'd included an old set of table definitions

DROP TABLE IF EXISTS local_linkslink;
CREATE TABLE local_linkslink (
linkid int(11) NOT NULL auto_increment,
linkname varchar(255) NOT NULL,
linkdesc text NOT NULL,
linkurl text NOT NULL,
linkimage text NOT NULL,
hits text NOT NULL,
linkforum smallint(5) NOT NULL,
linkcheck int(10) unsigned NOT NULL,
linkstatus smallint(2) NOT NULL,
PRIMARY KEY (linkid)
);


I re-ran the queries and got exactly the same error. My error is in the local_linkscat query.

AndrewD 01-18-2004 06:36 PM

Quote:

Originally Posted by Nmidia
I re-ran the queries and got exactly the same error. My error is in the local_linkscat query.

fixed, no longer relevant

Agree with you about the icons

Nmidia 01-18-2004 06:43 PM

Quote:

Originally Posted by AndrewD
Not sure what's happing to you - I tried the sql code and it's fine for me. Is this what you're trying to execute?

DROP TABLE IF EXISTS local_linkscat;
CREATE TABLE local_linkscat (
catid smallint(5) NOT NULL auto_increment,
catname varchar(255) NOT NULL,
catdesc text NOT NULL,
cattext mediumtext NOT NULL,
parentid smallint(5) NOT NULL,
parentlist varchar(250) NOT NULL,
catforum smallint(5) NOT NULL,
PRIMARY KEY (catid)
);

Agree with you about the icons

was being a bit of a muppet. Running that querry through my forum did nothing. I then ran it from PHPMyAdmin from host, importing the file did nothing. The I ran it in query window, worked. The entire thing works fine now:)

dede1 01-18-2004 06:52 PM

Quote:

Originally Posted by AndrewD
sorry - try downloading the zip again or use the definition below - I'd included an old set of table definitions

);

thanks l?uft jetzt

dede1 01-18-2004 07:36 PM

Error comes with me if I one left to insert wants:


Quote:

Database error in vBulletin 3.0.0 Release Candidate 2:
Invalid SQL:
SELECT mimetype
FROM attachmenttype AS attachmenttype
WHERE extension = 'php'
LIMIT 1;

mysql error: You have an error in your SQL syntax near ';
' at line 5

mysql error number: 1064

Date: Sunday 18th of January 2004 04:37:29 PM
Script: http://63.246.136.220/Board/local_li...tion=jump&id=4
Referer: http://63.246.136.220/Board/local_li...=links&catid=3
Username: Dede1
IP Address: xxxxxxxxxxxxxxx

gmarik 01-19-2004 07:09 AM

:rolleyes: Yes, icons are very important - 32x32 icons, that have the same id, as the cetegory. For example Photoshop link category with ID=4 has a gif stored in folder images/links called l04.gif and so, if the icon option is turned on, the users sees it - it's a very important thing and must be operated from the admin CP. http://tutorials.yaxay.com/

colicab-d 01-19-2004 07:13 AM

gmarik are you using andews files/link archive in those pictures or are you using your own one? if so why not release it, or maybe just to me :d lol

gmarik 01-19-2004 10:20 AM

I'm using my own, but I don't know how to code it vb3, if somebody could code it for me.

Dean C 01-19-2004 03:30 PM

Hehe you beat me to releasing mine - never mind ;) Looks good so far.

Dark_Wizard 01-19-2004 05:07 PM

Quote:

Originally Posted by gmarik
I'm using my own, but I don't know how to code it vb3, if somebody could code it for me.

Contact me via PM...

*arie 01-20-2004 07:14 PM

very nice.

/me clicks install.

limey 01-21-2004 01:32 AM

I'll say very nice and I love the way it works...admincp would be "nice" but its great anyway....nice job.

Didi_gt 01-23-2004 04:17 PM

Quote:

Originally Posted by dede1
Error comes with me if I one left to insert wants:

open local_links.php
search
PHP Code:

$jumpmime $DB_site->query("
SELECT mimetype 
FROM " 
TABLE_PREFIX "attachmenttype AS attachmenttype
WHERE extension = '
$type'
LIMIT 1;
"
); 

replace with:
PHP Code:

$jumpmime $DB_site->query("
SELECT mimetype 
FROM " 
TABLE_PREFIX "attachmenttype AS attachmenttype
WHERE extension = '
$type'
LIMIT 1
"
); 

save file & upload ...done

AndrewD 01-25-2004 09:03 AM

Version beta 0.2 released, see first post.

Many features added which have been suggested in this thread

dede1 01-25-2004 03:27 PM

Hello

if I want there

http://63.246.136.220/Board/local_links.php?action=links

that comes

PHP Code:

 Database error in vBulletin 3.0.0 Release Candidate 3:
Invalid SQL
  
SELECT link.linkid AS linkidlink.linkname AS linkname
   
link.linkurl AS linkurllink.linkdesc AS linkdesc
   
link.linkhits AS linkhitslink.linkstatus AS linkstatuslink.linkdate AS linkdate
  FROM local_linkslink 
AS link
  LEFT JOIN local_linksltoc 
AS ltoc
  ON link
.linkid ltoc.linkid
   
  WHERE
   ltoc
.catid = -1
   
AND link.linkforum NOT IN (0)
  
  
ORDER BY linkname
  
mysql error
Unknown column 'link.linkhits' in 'field list'
mysql error number1054
Date
Sunday 25th of January 2004 12:25:09 PM
Script
: [url="http://63.246.136.220/Board/local_links.php?action=links"]http://63.246.136.220/Board/local_links.php?action=links[/url]
Referer: [url="http://63.246.136.220/Board/local_links.php?action=admin"]http://63.246.136.220/Board/local_links.php?action=admin[/url] 


amairiya 01-25-2004 07:43 PM

I haven't installed this or anything, but let me say it looks really awesome and I will install it once it is in it's full release state.

I'm sorry if this is already previously mentioned, but does this allow for the admin to grant access to the files per usergroup? I would like to integrate having access to downloading the files to a premium/paid usergroup, but have the links database be accessible to all.... Is that already implemented? Thanks and sorry.

pcalloway 01-26-2004 04:03 AM

I installed this 0.2 version on my vb3.0 r3 board, following the instructions in the .txt but I can't tell if its working or not. I tried pointing toward /forum/local_links.php and just got a blank page.

How do I set this thing up and integrate it?

allan grossman 01-26-2004 05:24 PM

Quote:

Originally Posted by pcalloway
I installed this 0.2 version on my vb3.0 r3 board, following the instructions in the .txt but I can't tell if its working or not. I tried pointing toward /forum/local_links.php and just got a blank page.

How do I set this thing up and integrate it?

I haven't installed 0.2 but when I had that problem with 0.1 it was missing templates. Of course, YMMV ;)

pcalloway 01-27-2004 03:44 AM

Got another problem - finally got it running but now when I click a link I get:
Error - Link #pcalloway not set.

AndrewD 01-27-2004 07:13 PM

Quote:

Originally Posted by pcalloway
Got another problem - finally got it running but now when I click a link I get:
Error - Link #pcalloway not set.

Can you go into your VB adminCP, backup the four local_links tables and pm them to me, so that I can see what's going on?

AndrewD 01-27-2004 07:18 PM

Quote:

Originally Posted by amairiya
I haven't installed this or anything, but let me say it looks really awesome and I will install it once it is in it's full release state.

I'm sorry if this is already previously mentioned, but does this allow for the admin to grant access to the files per usergroup? I would like to integrate having access to downloading the files to a premium/paid usergroup, but have the links database be accessible to all.... Is that already implemented? Thanks and sorry.

Access to files/links and categories is controlled by assigning them to a forum. So if you want only some usergroups to see certain links, you assign these links (or their category) to a forum that has the same usergroup permissions. The association between link and forum or category and forum can be changed by anyone who has can_edit_link and/or can_edit_category access to the links database (set via the link_admin page).

AndrewD 01-27-2004 07:21 PM

Quote:

Originally Posted by dede1
Hello

if I want there

http://63.246.136.220/Board/local_links.php?action=links

that comes

PHP Code:

 Database error in vBulletin 3.0.0 Release Candidate 3:
Invalid SQL
  
SELECT link.linkid AS linkidlink.linkname AS linkname
   
link.linkurl AS linkurllink.linkdesc AS linkdesc
   
link.linkhits AS linkhitslink.linkstatus AS linkstatuslink.linkdate AS linkdate
  FROM local_linkslink 
AS link
  LEFT JOIN local_linksltoc 
AS ltoc
  ON link
.linkid ltoc.linkid
   
  WHERE
   ltoc
.catid = -1
   
AND link.linkforum NOT IN (0)
  
  
ORDER BY linkname
  
mysql error
Unknown column 'link.linkhits' in 'field list'
mysql error number1054
Date
Sunday 25th of January 2004 12:25:09 PM
Script
: [url="http://63.246.136.220/Board/local_links.php?action=links"]http://63.246.136.220/Board/local_links.php?action=links[/url]
Referer: [url="http://63.246.136.220/Board/local_links.php?action=admin"]http://63.246.136.220/Board/local_links.php?action=admin[/url] 


Have you upgraded the database as per instructions? linkhits was not in the v0.1 database.

dede1 01-27-2004 07:45 PM

linkhits? Is the templates?

Where is to be? I inserted 11 Templates

13th_Disciple 01-27-2004 11:52 PM

updating the database won't be a template.. there is probably a query you didn't run for the install of 0.2

check your install and make sure you followed all directions.. haven't installed this hack, but since it refers to an unknown column, that means there should be a column that isn't there and was probably added by a query for the install..

AndrewD 01-28-2004 04:24 AM

Quote:

Originally Posted by dede1
linkhits? Is the templates?

Where is to be? I inserted 11 Templates


The zip file that you downloaded contained a file called instructions.txt and a file called links_maketable.sql. This is only the beta 0.2 release, so you have to manually run the sql code in the second file, e.g. using phpmyadmin or the command line mysql.exe etc. This sets up the four tables and populates the admin table. The next release will automate this process. Sorry if this is confusing.

After installation, you will have four tables (all with names starting local_links), eleven templates (all with names starting links_) and one php file.

dede1 01-28-2004 06:25 AM

Yes that have I everything made.

Nevertheless this error comes

Natch 01-29-2004 02:07 AM

PM sent re: a HTL version I made for my own use ...

AndrewD 01-29-2004 05:32 PM

Quote:

Originally Posted by dede1
Yes that have I everything made.

Nevertheless this error comes

Pls use VB's adminCP to backup just the 4 local_links tables and pm then to me so that I can take a look.

SpankMe 01-31-2004 03:25 AM

Just installed this and found the following bug:

The userid and username are not added to the links db when a member adds a link.

replace:
PHP Code:

        $DB_site->query("
                INSERT INTO local_linkslink (linkname, linkurl, linkdesc, linkhits, linkforum, linkcheck, linkstatus, linkdate)
                VALUES (
                '"
.addslashes(htmlspecialchars($linkname))."',
                '
$linkurl',
                '"
.addslashes(htmlspecialchars($linkdesc))."',
                0,
                '
$pforum',
                
$statustime,
                
$statuscheck,
                
$statustime
                )
        "
); 

with:
PHP Code:

        $DB_site->query("
                INSERT INTO local_linkslink (linkname, linkurl, linkdesc, linkhits, linkforum, linkcheck, linkstatus, linkdate, linkusername, linkuserid)
                VALUES (
                '"
.addslashes(htmlspecialchars($linkname))."',
                '
$linkurl',
                '"
.addslashes(htmlspecialchars($linkdesc))."',
                0,
                '
$pforum',
                
$statustime,
                
$statuscheck,
                
$statustime,
                '"
.addslashes(htmlspecialchars($bbuserinfo[username]))."',
                
$bbuserinfo[userid]
                )
        "
); 

and replace:
PHP Code:

    $query "
                SELECT link.linkid AS linkid, link.linkname AS linkname, 

with:
PHP Code:

    $query "
                SELECT link.linkid AS linkid, link.linkname AS linkname, link.linkuserid AS linkuserid, 

and add the following:
PHP Code:

        $linkuserid $myrow["linkuserid"]; 

below this code:
PHP Code:

    while ($myrow=$DB_site->fetch_array($asb)) {
        
$linkid     $myrow["linkid"];
        
$linkname   parse_bbcode2($myrow["linkname"], 1111);
        
$linkurl    $myrow["linkurl"];
        
$linkhits   $myrow["linkhits"];
        
$linkstatus $myrow["linkstatus"]; 

also the templates are not setup to show the "edit" link for members own links.

In the links_linkbit template

replace:
HTML Code:

<if condition="$links_permissions[can_edit_link]>
with:
HTML Code:

<if condition="$links_permissions[can_edit_link] or $bbuserinfo[userid] == $linkuserid">
I think thats everything.

AndrewD 01-31-2004 05:52 AM

Quote:

Originally Posted by SpankMe
Just installed this and found the following bug:

The userid and username are not added to the links db when a member adds a link.

etc

I think thats everything.

Thanks - will make these fixes in the main release - the userid code was one of the more recent bits to go in. Appreciate your effort.

daFish 02-02-2004 08:55 AM

<font face="Arial">Great Hack but what about a HTL version?
Is there one available?

-Fish
</font>

AndrewD 02-02-2004 08:58 AM

Quote:

Originally Posted by daFish
Great Hack but what about a HTL version?
Is there one available?

-Fish

Yes, the next beta will be an HTL version - but give me a few days as I've a lot on this week.

Thanks to Natch for the insight into HTL.


All times are GMT. The time now is 04:50 PM.

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.02693 seconds
  • Memory Usage 1,902KB
  • 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
  • (2)bbcode_html_printable
  • (10)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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