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)

???`S?LV?R???` 02-27-2004 10:14 AM

Do you know around when this hack is gonna get a final version released?

AndrewD 02-27-2004 10:48 AM

Quote:

Originally Posted by ???`S?LV?R???`
Do you know around when this hack is gonna get a final version released?

Ha, ha! There's never a final release - didn't you know?

I plan to move this to the full release forum either this weekend or next, and call it version 1.0. There will be no further new functionality, apart from a slight tidying up, and I shall include Natch's integration with VBIndex for those who want it.

There is a wish list - particularly moderation and mass import/export of links, which will be done sometime.

OK?

???`S?LV?R???` 02-27-2004 11:21 AM

Sounds good, lol hopefully it's this weekend. This is a hack ive been requesting..etc for a while now since vb3 has been out.

raxafarian 02-27-2004 12:35 PM

I added a space between the description and the 'added' info. Makes it a bit more readable.

in template links_linkbit:

change
PHP Code:

$linkratebit
</span>
</
td>
<
td class="alt1">
<
span class="smallfont">$linkdesc
 
[Added$linkdate

to
PHP Code:

$linkratebit
</span>
</
td>
<
td class="alt1">
<
span class="smallfont">$linkdesc
<br />
 [
Added$linkdate



EDIT: this only inserts a space if you have no description. How can we get a space between the description and the 'added' text when there is a description entered? (other than putting a hard return in each description box when entering links)

AndrewD 02-27-2004 04:38 PM

Quote:

Originally Posted by raxafarian
I added a space between the description and the 'added' info. Makes it a bit more readable.

EDIT: this only inserts a space if you have no description. How can we get a space between the description and the 'added' text when there is a description entered? (other than putting a hard return in each description box when entering links)

I think the solution is to have a "table in a table" - it spreads things out a bit better than the break tag. I'll play around and see what it looks like. One point, though, is that I haven't coded multiple page handling, so all the links in one category appear together. The more one opens up the template, the longer the page becomes.

???`S?LV?R???` 02-28-2004 01:25 AM

Before I install this I gotta few questions that I wanna clear up... you can put permissions on the link itself right? rather than sticking the link somewhere on the forum and setting certain permissions to the view of the page. I remember vbportal had a downloads page and they could specify permissions on the files rather than just the page. So that's what im wondering about this, and if it does, does it have a file size limit? Cause i know when you cant add big files on VB attachments cause of the mysql limits..etc

raxafarian 02-28-2004 01:47 AM

Quote:

Originally Posted by ???`S?LV?R???`
Before I install this I gotta few questions that I wanna clear up... you can put permissions on the link itself right? rather than sticking the link somewhere on the forum and setting certain permissions to the view of the page. I remember vbportal had a downloads page and they could specify permissions on the files rather than just the page. So that's what im wondering about this, and if it does, does it have a file size limit? Cause i know when you cant add big files on VB attachments cause of the mysql limits..etc

you specify a forum 'parent' for each link which determines the viewing permission.

???`S?LV?R???` 02-28-2004 01:50 AM

but that wouldnt really protect the file, cause then people could just give out links still

AndrewD 02-28-2004 06:14 AM

Quote:

Originally Posted by ???`S?LV?R???`
but that wouldnt really protect the file, cause then people could just give out links still

The permissions system works in two ways, both building on VB's usergroups:

a) Ability to "do" certain things. You set this in the admin pages, by defining which usergroups can create links, categories, etc. Only a user who is a member of one of the specified groups can carry out the specified task.

b) Ability to "view" things. When you create/edit a link or category, you "assign" a forumid to the link/category. This may be explicit or implicit - i.e. if the user has can_set_permissions (see previous item), then that user can choose which forum to assign to the link, otherwise the default choice set by the administrator is used.

Whenever one of your users views these pages, she will only see links and categories for which her usergroup has the appropriate forum permission. I.e. if that group can see and visit a particular forum, then she can see and visit links associated with that forum.

This also works when trying to download a file. These are set up as a call to local_links.php?action=jump&id=n. If someone tries to get round the system by simply choosing a random number (or if someone tells someone else what number to enter), the code still checks to see if that usergroup has the relevant permission, and refuses the download if not. The user never gets to see where the actual file is stored.

Of course, if someone actually knows where the file is really stored, and gives out that information, then it is perfectly possible to bypass the whole security system. But that is nothing to do with this hack.

Clear?

???`S?LV?R???` 02-28-2004 08:00 AM

alright i understand all that... but what if they were on a custom page on vbindex, that rule wouldnt apply anymore right?

13th_Disciple 02-28-2004 06:13 PM

pm a mod or admin and ask them to move it to the proper area of full release forums..

AndrewD 03-02-2004 10:12 AM

This has now gone to full release 1.0 and moved to the main hack forum

Zhin Jio 03-02-2004 08:23 PM

I'm having only one issue. It appears that any attempt to 'edit' an existing category automatically sets its catforum to 0. Since I'm not using forum based permissions, I'd like it to remain -999. I'm going to do some more looking around, but this creates some pretty odd behavior.

Otherwise, fantastic hack. I've been waiting for this one to appear. Install was smooth. I've made a slight mod to use to use 'star' images instead of a number rating, since I'm already using those star images on the page elsewhere, and they're cached. Nice and quick.

Installed.

- ZJ

trilOByte 03-02-2004 11:11 PM

Excellent Hack - fantastic.

[high]* trilOByte clicks install
[/high]

One problem though, I inseted a category as a sub category, when I wanted it as a parent. I tried to move it and got a nopermission error (I'm primary admin, group 6), every attempt to acces thereafter and I get nopermission (I have permissions set to a -ve value). I deleted the category (catid = 3) using phpMyadmin (does only having catid's 1,2,4 cause a problem?) and everything else seems to work OK. I dont know why this happened, just thought I'd bring it to your attention.

Thanks for a great hack. :)

trilOByte 03-02-2004 11:18 PM

Quote:

Originally Posted by Zhin Jio

I've made a slight mod to use to use 'star' images instead of a number rating, since I'm already using those star images on the page elsewhere, and they're cached. Nice and quick.

Installed.

- ZJ

What's that mod? I'd like to do that myself. ;)

trilOByte 03-02-2004 11:57 PM

Oops, fairly big problem - relating to my post on the previous page. If I attempt to edit any of the categories, I get a nopermission error and the category vanishes from the listing. I cant access the category thereafter. It shows in the statistics, but that is the only place I can see evidence of it's existance - aside from the dB itself.

As I said before, I'm primary admin, userid = 1, usergroup = 6. Changing permissions from a -ve value to +ve and specifying forums, makes no difference.

AndrewD 03-03-2004 04:18 AM

Quote:

Originally Posted by trilOByte
Excellent Hack - fantastic.

[high]* trilOByte clicks install
[/high]

One problem though, I inseted a category as a sub category, when I wanted it as a parent. I tried to move it and got a nopermission error (I'm primary admin, group 6), every attempt to acces thereafter and I get nopermission (I have permissions set to a -ve value). I deleted the category (catid = 3) using phpMyadmin (does only having catid's 1,2,4 cause a problem?) and everything else seems to work OK. I dont know why this happened, just thought I'd bring it to your attention.

Thanks for a great hack. :)

OK, I'll try to track this down - there's a couple of people finding that something goes wrong with editing categories. Thanks.

Natch 03-03-2004 04:53 AM

Quote:

Originally Posted by ???`S?LV?R???`
alright i understand all that... but what if they were on a custom page on vbindex, that rule wouldnt apply anymore right?

The links will display on the vBIndex front page with my addon regardless of permissions, but if a user does not have permission to download, then the link will point to a standard vB "No Permissions" page ...

Zhin Jio 03-03-2004 06:02 AM

Quote:

Originally Posted by trilOByte
What's that mod? I'd like to do that myself. ;)

Two steps: In the 'ratebit' template, change:
Code:

<br /><span class="smallfont">rated <b>$linkrate</b> star</span>
to:
Code:

<br /><span class="smallfont">rated: $linkrate</span>
Then, in the local_links.php file, find:
PHP Code:

                if (isset($links_totrate[$linkid])) {
                        
$linkrate round($links_totrate[$linkid] / $links_numrate[$linkid]);
                        eval(
"\$linkratebit = \"".fetch_template('links_ratebit')."\";"); 

and change it to:
PHP Code:

                if (isset($links_totrate[$linkid])) {
                        
$lr round($links_totrate[$linkid] / $links_numrate[$linkid]);
                        
$linkrate "";
                        
$i 0;
                        while ( 
$i $lr ) {
                                
$linkrate $linkrate '<img src="http://pebkac.trippy.org/forums/images/stars/level1.gif"> ';
                                
$i++;
                        }
                        eval(
"\$linkratebit = \"".fetch_template('links_ratebit')."\";"); 

Obviously, use your own URL to the star image. This isn't fancy, but it works. Hope that helps...

- ZJ

Zhin Jio 03-03-2004 06:04 AM

Quote:

Originally Posted by AndrewD
OK, I'll try to track this down - there's a couple of people finding that something goes wrong with editing categories. Thanks.

Yeah, I went as far as finding that this changed the catforum to '0', but not *why* it was doing this. Thanks for looking into this. It seems to apply to making *any* edit to a category... primary/secondary descriptions, parent, etc.

I did look in the code. There was a variable 'pforum' that is being saved to the catforum column in the db. Is that right variable? Was it initialized?

I'll butt out now *grin*....

- ZJ

Zhin Jio 03-03-2004 06:09 AM

Quote:

Originally Posted by trilOByte
Oops, fairly big problem - relating to my post on the previous page. If I attempt to edit any of the categories, I get a nopermission error and the category vanishes from the listing. I cant access the category thereafter. It shows in the statistics, but that is the only place I can see evidence of it's existance - aside from the dB itself.

As I said before, I'm primary admin, userid = 1, usergroup = 6. Changing permissions from a -ve value to +ve and specifying forums, makes no difference.

If you can play in the db, and want a temporary fix until Andrew comes up with a real one... do something like:

Code:

UPDATE local_linkscat SET catforum=-999 WHERE catforum=0;
YMMV.

- ZJ

AndrewD 03-03-2004 06:22 AM

Quote:

Originally Posted by Zhin Jio
If you can play in the db, and want a temporary fix until Andrew comes up with a real one... do something like:

Code:

UPDATE local_linkscat SET catforum=-999 WHERE catforum=0;
YMMV.

- ZJ

I think I see where the problem lies, but it will have to wait until I get home from work to test and fix. Sorry, guys!

Raimund 03-03-2004 08:34 AM

great hack! install worked flawless!

is there an easy way to import links from a text file?

AndrewD 03-03-2004 05:56 PM

Quote:

Originally Posted by Raimund
great hack! install worked flawless!

is there an easy way to import links from a text file?

No, but there should be! What format do you keep your links in?

trilOByte 03-03-2004 06:26 PM

Andrew, I ran Zhin Jio's query and uploaded your new php file, my vanished categories reappeared and it would appear I can now edit them without problems.

You're a star. Thanks to you and Zhin Jio for the speedy fix (and thanks ZJ for the stars mod).

Cheers,
Great hack Anderw. ;)

Zhin Jio 03-03-2004 08:40 PM

Quote:

Originally Posted by trilOByte
You're a star. Thanks to you and Zhin Jio for the speedy fix (and thanks ZJ for the stars mod).

Happy to help...

- ZJ

Chrissicom 03-04-2004 10:13 PM

Uhm sorry for the stupid question but in what way is this hack a file database?!?!?! I can only see a links database when I install it. I would be looking for a file database where I can add movies, with a screenshot, movie info etc.

raxafarian 03-04-2004 11:47 PM

Quote:

Originally Posted by Chrissicom
Uhm sorry for the stupid question but in what way is this hack a file database?!?!?! I can only see a links database when I install it. I would be looking for a file database where I can add movies, with a screenshot, movie info etc.

If you put a link to a file, then when clicked, the file will be downloaded. You can use vb code for images.

???`S?LV?R???` 03-06-2004 07:04 AM

I'm somewhat confused.. lol I think it's more so that I'm tired. i keep getting this message when i try to add a link "(not available)" can someone post a screenshot of an already setup setting for the added link so i can compare it with mine.

AndrewD 03-06-2004 07:45 AM

Quote:

Originally Posted by ???`S?LV?R???`
I'm somewhat confused.. lol I think it's more so that I'm tired. i keep getting this message when i try to add a link "(not available)" can someone post a screenshot of an already setup setting for the added link so i can compare it with mine.

How about posting exactly the string that you are entering into the url box? It should look something like the following
HTML Code:

http://www.bbc.co.uk
The "not available" message means that the script has tried to access the URL you specified and has failed.

???`S?LV?R???` 03-06-2004 07:47 AM

In the url box i just put the source of the file right? http://www.example.com/test/example.mp3

AndrewD 03-06-2004 08:02 AM

Quote:

Originally Posted by ???`S?LV?R???`
In the url box i just put the source of the file right? http://www.example.com/test/example.mp3

Should work fine - sure there are no spaces or something in your filename? I just tried this with an mp3 and everything was ok.

Give me the link to an mp3 on your site and I'll try to link to it.

AndrewD 03-06-2004 08:05 AM

I have fixed the category bugs reported earlier this week. Please reinstall, as there is also a template fix.

To confirm - if you had left the default permissions forumid as -999 and you edited a category without selecting another forum, then the category would disappear into the big blue yonder.

If you have encountered this problem, you can repair it by running the sql query given by Zhin Jio.

PHP Code:

UPDATE local_linkscat SET catforum=-999 WHERE catforum=0


AndrewD 03-06-2004 08:19 AM

Quote:

Originally Posted by ???`S?LV?R???`
In the url box i just put the source of the file right? http://www.example.com/test/example.mp3

Another thought - what web server software are you using? If you refer to a file on your local server (i.e. skip the http: stuff), then my code looks for a file somewhere below $_SERVER["DOCUMENT_ROOT"]. I think this should be set with a correctly configured server.

???`S?LV?R???` 03-06-2004 09:18 AM

im confused what you mean andrew..

AndrewD 03-06-2004 09:19 AM

Quote:

Originally Posted by ???`S?LV?R???`
im confused what you mean andrew..

Your forum is hosted on a site that runs a certain type of web server. Do you know what the server software is? e.g. is is Apache, etc?

???`S?LV?R???` 03-06-2004 09:21 AM

apache

AndrewD 03-06-2004 09:39 AM

Quote:

Originally Posted by ???`S?LV?R???`
apache

OK, then can you give me the *exact* file name you were putting into the URL box?

???`S?LV?R???` 03-06-2004 09:41 AM

asksd.mp3

AndrewD 03-06-2004 10:01 AM

Quote:

Originally Posted by ???`S?LV?R???`
asksd.mp3

OK, there is a bug in my code, but there are two ways round this.

1) Simply put either a forward slash in front of asksd.mp3, i.e /asksd.mp3, or use a full URL, i.e. http://yoursite/asksd.mp3

2) VB comes pre-configured to handle downloads of bmp, doc, gif, jpg, pdf, png, psd, txt and zip. To handle mp3, you have to go into your VBulletin AdminCP, and set up the proper mimetype for MP3 files. This is done under "Attachments". I'd have to check the right mimetype.

Your easiest option is probably (1) - can you try it and see. Can you also upload the attached file, tryit.php, onto your server, run it and let me know what it prints.


All times are GMT. The time now is 01:19 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.02020 seconds
  • Memory Usage 1,868KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (5)bbcode_php_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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