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)

Allan 04-28-2005 05:04 PM

Quote:

Originally Posted by AndrewD
It will be trivial, if fact even easier than that :)

yesssssssss, thanks AndrewD :)

AndrewD 04-28-2005 05:14 PM

Quote:

Originally Posted by sherykah
hello Andrew,

I've installed your this code onto my board and i like it very much. I would like to use it in a second version to collect information in a directory format. Your program is very simple to use and I want to know if a can use it again with one code change. I need to turn off the link verifcation system. I want a member to add information on a performance location that maynot have a web address. I will need to turn off the need to add a url and the verifcation of a url being added to every entry. Is this possible?

This is already coded - if you go to the admin page and set allow_null_links to 1, then the url field can be left empty. You may want to change some of the phrases to explain the consequences. You should probably also edit local_links.php, go to the section which starts
Code:

// #################### Add Entry
if ($_REQUEST['action'] == "addlink") {

and change the line
Code:

$linkurl = "http://";
to whatever you want to
Code:

$linkurl = "";
If you want to skip showing the url box altogether, then you need to edit the link_addnewlink templates, and change the line
Code:

<input type="text" class="bginput" name="linkurl" value="$linkurl" size="50" />
, e.g. to [code]<input type="hidden" name="linkurl" value="$linkurl" />

sherykah 04-28-2005 05:55 PM

Andrew,
Thank you very much.

FightRice.com 04-29-2005 12:59 AM

I installed this on my forums. And simply amazing.

good job andrewD and i don't feel like reading this whole 70page post so is there any useful information in it for some modifications to this for like a Drop down box(like the QuickLinks) and then be able to select Add Lnk, View Links And things like that

AndrewD 04-29-2005 03:59 AM

Quote:

Originally Posted by FightRice.com
I installed this on my forums. And simply amazing.

good job andrewD and i don't feel like reading this whole 70page post so is there any useful information in it for some modifications to this for like a Drop down box(like the QuickLinks) and then be able to select Add Lnk, View Links And things like that

Thanks

I don't think I've answered that question before ;)

What features would you like to see on a QuickLinks drop down? No promises...

emtee 04-29-2005 05:46 AM

It's very easy to make the Drop down box like vb3 default's Quick Links if you know a little bit HTML. Open navbar template and navbar_link template and read them. You should be able to figure it out how to make drop down links. Good luck!

AndrewD 04-30-2005 07:13 AM

Supported release is now 1.60b (see first post in this thread for details).

Andrew

Slave 04-30-2005 08:24 AM

Installed .. :)

Can't see anything wrong at the moment AndrewD .. nice job! .. :)

Allan 04-30-2005 08:35 AM

Quote:

Originally Posted by AndrewD
This is a good idea. I will make a couple of changes in 1.60b (coming this weekend) to show the new links:
- The home category display will indicate the number of new entries since the last visit, with a clickable link to display them all
- The "Show What's New" will do the same thing if *days_seen_on_portal* is set to zero.

I hope this what you want.


It was to add in this version AndrewD ?

AndrewD 04-30-2005 08:59 AM

Quote:

Originally Posted by Allan
It was to add in this version AndrewD ?

Yes, it's there.

The links home page now has a banner heading with a clickable line "N new entries since last visit". The pull down menu item "Show What's New" will show these entries provided the parameter *days_seen_on_portal* is set to 0.

Allan 04-30-2005 04:49 PM

I have to throw the update and he says to me :

Code:

Upgrade vb Links to Links and Files 1.60
Checking installation status...
I cannot find the vb Links tables in this database - unable to continue.

:(

AndrewD 04-30-2005 06:26 PM

Quote:

Originally Posted by Allan
I have to throw the update and he says to me :

Code:

Upgrade vb Links to Links and Files 1.60
Checking installation status...
I cannot find the vb Links tables in this database - unable to continue.

:(

You're trying to run the 'upgrade_vblinks' script, which is intended to upgrade people from the similar hack that was written for VBulletin version 2.

All you need to do to upgrade this hack is re-run the normal installation script, local_links_install.php. It works out what to do.

calorie 05-07-2005 03:31 AM

<font face="Courier New">
This extension allows registered users to rate and comment on entries. The extension was built around version 1.60b of AndrewD's L&F DB hack. This is a "Thanks to Andrew" extension, but support is not guaranteed. Make backups of your files, tables, templates, etc. before installing. Of course, you assume the full risk should you install this extension.
</font>

RichieBoy67 05-07-2005 03:39 AM

Nice addon!!! Thanks...

calorie 05-07-2005 03:55 AM

You're welcome. DL the instructions again though, as I forgot a template in the instructions. If anyone DLs after this point, the template has been added to the instructions. Also before anyone asks, if you want to show more than one comment per entry, just change the $comment_cutpoint = 1; variable in the new get_linksratings function. Of course, you need to allow rating for the extension to work.

Quote:

Originally Posted by RichieBoy67
Nice addon!!! Thanks...


calorie 05-07-2005 06:12 AM

<font face="Courier New">
These edits basically change the search so that LIKE queries are used instead of MATCH AGAINST queries. Note that LIKE queries may be slower than MATCH AGAINST queries, so only apply these changes if wanted. However, you may find that you get more meaningful results using LIKE queries instead of MATCH AGAINST.
</font>

AndrewD 05-07-2005 09:58 AM

Quote:

Originally Posted by calorie

These edits basically change the search so that LIKE queries are used instead of MATCH AGAINST queries. Note that LIKE queries may be slower than MATCH AGAINST queries, so only apply these changes if wanted. However, you may find that you get more meaningful results using LIKE queries instead of MATCH AGAINST.

Perhaps it's worth explaining the difference between boolean fulltext searches and LIKE searches in MySQL?

Early versions of this hack used LIKE (which is also used by the release version of VBulletin). This allows you to find a search string, with an optional wildcard or so. Boolean fulltext also allows you to look for combinations of words, strings, etc, so that if you search for (e.g.) +book -page, you will find entries with the word book but not page.

calorie 05-07-2005 02:23 PM

True, but if you use MATCH AGAINST then you may be at the "mercy" of MySQL's minimum word length, stop words, fifty percent threshold, definition of word, special characters. For anyone interested, visit here. It's a matter of preference, so "only apply these changes if wanted." ;)

Quote:

Originally Posted by AndrewD
Perhaps it's worth explaining the difference between boolean fulltext searches and LIKE searches in MySQL?

Early versions of this hack used LIKE (which is also used by the release version of VBulletin). This allows you to find a search string, with an optional wildcard or so. Boolean fulltext also allows you to look for combinations of words, strings, etc, so that if you search for (e.g.) +book -page, you will find entries with the word book but not page.


skokarl 05-07-2005 03:00 PM

@AndrewD

excuse my bad english ...

I use your hack..and it is very fine ! Thank you for the hack.

Bur I only need the downloads ...not the links.

Can you in the future make a hack only for downloads ?
I doesn't know about a good download hack...so I use your hack for my downloads....

but many of the queries and menus and tables are not necessary ..

greetings from germany ..

calorie 05-07-2005 07:53 PM

<font face="Courier New">
These are my notes on how to install AndrewD's LFDB in a directory outside the main forum directory. I cannot guarantee completeness, accuracy, or support, but I give these instructions to you should you wish to install AndrewD's LFDB outside of your forum directory. The main thing with doing this is that you really need to take care about paths and links. Chances are good that if you have a problem, then there is a path or link that needs to be changed to something else. This is a tedious process, be sure, but once done you can call http://www.your-domain.com/links/index.php and get a warm and fuzzy feeling.
</font>

Imperial Fritz 05-07-2005 10:48 PM

You are doing an amazing job :D

(still I must do my job and report a forgotten non-phrased word - in linkbit new links are marked with "*New*" instead of something like "*$vbphrase[ll_new]*"

;)

Thanks for all your work so far :)

AndrewD 05-08-2005 03:42 AM

Quote:

Originally Posted by calorie

These are my notes on how to install AndrewD's LFDB in a directory outside the main forum directory. I cannot guarantee completeness, accuracy, or support, but I give these instructions to you should you wish to install AndrewD's LFDB outside of your forum directory. The main thing with doing this is that you really need to take care about paths and links. Chances are good that if you have a problem, then there is a path or link that needs to be changed to something else. This is a tedious process, be sure, but once done you can call http://www.your-domain.com/links/index.php and get a warm and fuzzy feeling.

Hey man, I appreciate all the help - especially the facility to add comments - but is there a long string of these changes to come? If so, we need to think about how these will be supported as and when the main code evolves.

AndrewD 05-08-2005 04:00 AM

Quote:

Originally Posted by Imperial Fritz
You are doing an amazing job :D

(still I must do my job and report a forgotten non-phrased word - in linkbit new links are marked with "*New*" instead of something like "*$vbphrase[ll_new]*"

;)

Thanks for all your work so far :)

Thanks for spotting this. Patched version uploaded - there's a one line change in the template file and an extra phrase.

AndrewD 05-08-2005 04:03 AM

Quote:

Originally Posted by skokarl
@AndrewD

excuse my bad english ...

I use your hack..and it is very fine ! Thank you for the hack.

Bur I only need the downloads ...not the links.

Can you in the future make a hack only for downloads ?
I doesn't know about a good download hack...so I use your hack for my downloads....

but many of the queries and menus and tables are not necessary ..

greetings from germany ..

Skokarl, do you want to change the wording of the menus or do you want to make bigger changes - maybe you could explain?

skokarl 05-08-2005 04:52 AM

I want a smaller programm ... ;)

a very small and simple file database ..., ( in the future )

there are a lot of things which i don't understand ...import, export, Scan site for new files, ...all the things for the LINKS feature ....

sorry for the wish ...like this ??
but I know you can do this .. ;)

may be in the future.

AndrewD 05-08-2005 05:07 AM

Quote:

Originally Posted by skokarl
I want a smaller programm ... ;)

a very small and simple file database ..., ( in the future )

there are a lot of things which i don't understand ...import, export, Scan site for new files, ...all the things for the LINKS feature ....

sorry for the wish ...like this ??
but I know you can do this .. ;)

may be in the future.

Indeed, maybe in the future, but I'm not sure why this change would make the database any smaller? There is (I think) only one feature that causes the database to grow - this is keeping track of who has accessed a link/download. You can turn that off on the admin page.

The points you mention though - import, export, scan - make life easier for the admin. Import and export provide a simple text file format for backing up and re-installing your links/downloads. Scan provides an easy way to pre-load your database with your downloads - you can upload a whole set into one of your website directories, then use the scan feature to read these all into the database at once.

CSS59 05-08-2005 05:09 AM

is there "Top Rated" from all the rated links option?

AndrewD 05-08-2005 05:29 AM

Quote:

Originally Posted by CSS59
is there "Top Rated" from all the rated links option?

Not at present - 'Show What's Hot' sorts by number of hits. Not hard to add, if this is an important feature.

calorie 05-08-2005 01:56 PM

Sorry, but I don't guarantee support for any of my mods. Perhaps this may make some people unhappy, but I have time constraints. There are other ideas that I have about the comments extension. Maybe I should start a thread in the Add-On forum, or maybe you are planning on integrating some of the things I posted? Anyway, you might want to make the following changes to your LFDB system. The first change prevents a search on "<h1>foobar</h1>" from interpreting the HTML, and the second change encodes the partial URL though it looks like it doesn't get used.

Code:

//===================================================================================================================
In the 'if ($_REQUEST['action'] == "show")' statement of local_links.php find:
//===================================================================================================================

        if ($sstring <> "") $message .= ' '.$vbphrase['ll_matching'].' '.$sstring;

//===================================================================================================================
And replace with:
//===================================================================================================================

        if ($sstring <> "") $message .= ' '.$vbphrase['ll_matching'].' '.htmlspecialchars($sstring,ENT_QUOTES);

//===================================================================================================================
In the 'if ($_REQUEST['action'] == "show")' statement of local_links.php find:
//===================================================================================================================

        if ($sstring <> "") $action = "&amp;search=$sstring";
        if ($sforum <> "") $action .= "&amp;forum=$sforum";

//===================================================================================================================
And replace with:
//===================================================================================================================

        if ($sstring <> "") $action = "&amp;search=".urlencode($sstring);
        if ($sforum <> "") $action .= "&amp;forum=".urlencode($sforum);

Quote:

Originally Posted by AndrewD
Hey man, I appreciate all the help - especially the facility to add comments - but is there a long string of these changes to come? If so, we need to think about how these will be supported as and when the main code evolves.


AndrewD 05-08-2005 05:00 PM

Quote:

Originally Posted by calorie
Sorry, but I don't guarantee support for any of my mods. Perhaps this may make some people unhappy, but I have time constraints.

.. as do we all ...

Actually, I'm quite happy to integrate some of these ideas into the main code - this is has been happening all along for this hack.

calorie 05-08-2005 05:24 PM

True, but I doubt I could find adequate time to provide consistent support, so I don't guarantee it. Anyway, what ideas would you integrate? I like the comments extension, but I'm thinking it might need a new layout, perhaps a while loop to template each comment, pagination on the view all list, maybe a link to comment instead of the comment box, blah blah. None too hard, just some of that time... ;)

Quote:

Originally Posted by AndrewD
.. as do we all ...

Actually, I'm quite happy to integrate some of these ideas into the main code - this is has been happening all along for this hack.


Slave 05-09-2005 11:26 AM

Quote:

Originally Posted by AndrewD
Actually, I'm quite happy to integrate some of these ideas into the main code - this is has been happening all along for this hack.

Which is what I'll be waiting for .. I'd much perfer to see the comments subhack as part of the main hack .. with all of the intergration that would include (permissions etc) ..

Looking forward to it if it happens, but saying that I'm very happy with the hack as it is .. :)

calorie 05-09-2005 08:10 PM

<font face="Courier New">
While I cannot guarantee completeness, accuracy, or support, here are some LFDB hack suggestions. The input is checked (intval, addslashes, etcetera) but there are spots that do not set default values or check permissions should someone save the HTML, mess with the HTML, and then submit changes to the script, or should someone alter or create a query string and submit changes that way. For example, a user who does not have permission to add a link could set $action to doaddlink and add a link even though, when $action is set to addlink, the user is told to bugger off. Another example is when $action is set to dosendtofriend. Pass the appropriate variables and send email even though, when $action is set to sendtofriend, permissions are checked. Suggestions, FWIW.
</font>

calorie 05-09-2005 08:43 PM


In local_links.php find:
Code:

if ($_REQUEST['action'] == "doeditlink") {
And afterwards find:
Code:

                foreach ($pcatid as $p) {
                        $DB_site->query("
                        INSERT INTO ".THIS_TABLE."linksltoc (linkid, catid)
                        VALUES ('$viewlinkid', '$p')
                        ");
                }

And replace with:
Code:

                foreach ($pcatid as $p) {
                        $DB_site->query("
                        INSERT INTO ".THIS_TABLE."linksltoc (linkid, catid)
                        VALUES ($viewlinkid, ".intval($p).")
                        ");
                }

Maybe it'd be better to check that $pcatid (and other variables) contain valid value(s) before getting to a query. FWIW. :)

AndrewD 05-10-2005 04:13 AM

Calorie - I'm very happy to have these suggestions, particularly to improve stability, etc. But it would probably be easier for others and for me if you simply PM me or email me with your comments rather than overloading this thread.

Thanks and OK?

Tradjick 05-10-2005 09:28 PM

As I couldn´t find a ´m trying to set this up as a store directory where users can submit their articles and services, which they can trade with the ushop money OR with the money from a partner assossiation.

It seems to be very easy, but i just have the following questions:

Is it possible that a user can edit only his own links and not those submitted by others?

Is there a way to tell in the template the instruction that:

if the category is not one of the following (1,4,6,7,9), bypass this and that.

(i need such a conditional for having the rating feature only for selected categories, or f.ex. remove the "new link textfield box", etc.)

Or maybe there´s a better way for doing this? I don´t know.

I´d be very happy if someone can help me.

AndrewD 05-11-2005 04:17 AM

Quote:

Originally Posted by Tradjick
Is it possible that a user can edit only his own links and not those submitted by others?

This is already possible. A link can always be edited by the submitting user and *also* by users who are in groups that have *can_edit_link* privilege (go to the links admin page). By default, *can_edit_link* is set so that only members of the admin group have this privilege.

Quote:

Originally Posted by tradjick
Is there a way to tell in the template the instruction that:

if the category is not one of the following (1,4,6,7,9), bypass this and that.

(i need such a conditional for having the rating feature only for selected categories, or f.ex. remove the "new link textfield box", etc.)

Or maybe there?s a better way for doing this? I don?t know.

I?d be very happy if someone can help me.

I'll think about this and let you know.

Tradjick 05-11-2005 03:09 PM

Thanks, Andrew!

I´m going on with the following condition in order to choose the available features per category:

<if condition="$viewcatid == X">action here...</if>

I´m currently trying to figure out how to create an attitional userfield in order to fetch the value into a template, but it´s not so easy. :hurt:

Tradjick 05-11-2005 07:06 PM

I just altered the links_linkbit a little bit. If anyone likes it, here?s the code:

HTML Code:

<tr>  <td class="alt$linkstyle" colspan="2">  <fieldset class="fieldset" style="margin: 0px 0px 0px 0px;">  <legend style="background: white; border: 2px;">    </legend>  <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr>  <if condition="$linkimg">  <td width="$linkimgsize">  <if condition="$linkurl"><a <if condition="$linkmode<2">href="local_links.php?action=jump&amp;id=$linkid"<else />href="$linkurl"</if> target="_blank"></if>  <img src="local_resize.php?pic=$linkimg&amp;size=$linkimgsize" border="0" alt="" /><if condition="$linkurl"></a></if>  </td>  <td width="2">&nbsp;</td>  </if>  <td valign="bottom">      <fieldset class="fieldset" style="margin: 5px 0px 5px 10px;">  <legend><strong>  <if condition="$linkurl">$linktypebit <a <if condition="$linkmode<2">href="local_links.php?action=jump&amp;id=$linkid"<else />href="$linkurl"</if> target="_blank"></if>$linkname<if condition="$linkurl"></a></if>  <if condition="$linknew">$vbphrase[ll_new]</if>  </strong>  <if condition="$links_permissions[can_mark_link]">  <if condition="$linkfav">  <if condition="$viewcatid!=-2"> <span class="highlight">$vbphrase[ll_myfav]</span></if>  [<a href="local_links.php?action=dofavlink&amp;id=$linkid&amp;set=-1&amp;catid=$viewcatid&amp;page=$pagenumber" title="$vbphrase[ll_myfav_del]">$vbphrase[ll_ab_favminus]</a><else />  [<a href="local_links.php?action=dofavlink&amp;id=$linkid&amp;set=1&amp;catid=$viewcatid&amp;page=$pagenumber" title="$vbphrase[ll_myfav_add]">$vbphrase[ll_ab_favplus]</a></if>  <if condition="$links_permissions[can_send_tofriend]">  [<a href="local_links.php?action=sendtofriend&amp;id=$linkid" target="_blank" title="$vbphrase[ll_sendtofriend]">$vbphrase[ll_ab_send]</a></if>  </if>  &nbsp;        <if condition="$viewcatid == 4"><span align = "right" style="color : green; align : right; text-decoration : underline;">==OFFRE==</span></if>  </legend>      <BR />  <span class="smallfont">  $linkdesc  <if condition="$linkshowothercatbit>0"><br /><br />$vbphrase[ll_seealso] $linkothercatsbit</if>  </span>  </td>    <td width="25%" align="right" valign="bottom">  <fieldset class="fieldset" style="margin: 5px 5px 5px 5px;">  $linkratebit  <span class="smallfont">  $linkdate  <if condition="$linkstatus>1"> [$linkstatus $vbphrase[ll_kb]]</if>  <if condition="$linkstatus==0"> [$vbphrase[ll_unknown_status]]</if>  <if condition="$links_permissions[can_view_hits]">  <br />$vbphrase[ll_submitby] <a href="member.php?u=$linkuserid">$linkusername</a>  <br />$vbphrase[ll_hits] $linkhits  </if>  <if condition="$links_permissions[can_rate_link]">  <br />$vbphrase[ll_rate]  <a href="local_links.php?action=doratelink&amp;vote=1&amp;id=$linkid&amp;catid=$viewcatid&amp;page=$pagenumber">1</a><a href="local_links.php?action=doratelink&amp;vote=2&amp;id=$linkid&amp;catid=$viewcatid&amp;page=$pagenumber">2</a><a href="local_links.php?action=doratelink&amp;vote=3&amp;id=$linkid&amp;catid=$viewcatid&amp;page=$pagenumber">3</a><a href="local_links.php?action=doratelink&amp;vote=4&amp;id=$linkid&amp;catid=$viewcatid&amp;page=$pagenumber">4</a><a href="local_links.php?action=doratelink&amp;vote=5&amp;id=$linkid&amp;catid=$viewcatid&amp;page=$pagenumber">5</a></if>  <if condition="$links_permissions[can_moderate_links] and $linkstatus==$LINK_HIDDEN">  <br />  [$vbphrase[ll_hidden]]  </if>  <if condition="$links_permissions[can_edit_link] or $bbuserinfo[userid] == $linkuserid">  <br />  <a href="local_links.php?action=editlink&amp;linkid=$linkid&amp;catid=$viewcatid&amp;page=$pagenumber" title="$vbphrase[ll_edit]">$vbphrase[ll_editlc]</a>  </if>  </span>  </td>  </fieldset>  </fieldset>  </tr>  </table>  </fieldset>  </td>  </tr>
Does one have to make the line breaks manually in vB HTML code? I copied from Uedit.

Tradjick 05-11-2005 10:45 PM

When i save the settings i run into the following error. It saves things correctly, but what is it that´s causing this?

Warning: implode(): Bad arguments. in /local_links_admin.php on line 730

Warning: implode(): Bad arguments. in /local_links_admin.php on line 837


All times are GMT. The time now is 04:57 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.03688 seconds
  • Memory Usage 1,920KB
  • 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
  • (10)bbcode_code_printable
  • (1)bbcode_html_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