vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Major Additions - Links and Downloads Manager (https://vborg.vbsupport.ru/showthread.php?t=119041)

Ipuck 12-18-2007 02:27 AM

Quote:

Originally Posted by AndrewD (Post 1402950)
If you want to test LDM 2.2.8 with vb3.7, you will need the attached includes/local_links_init.php

Grateful for reports - first impression is that it still works.

I was about to post the problem here.

Thank you AndrewD you are the best!!!

Ron1213 12-18-2007 08:18 AM

First of all, great hack.

I have problem adding some news in the main LDM page, which template should make a change to add some news about files (above categories, under LDM title). I saw link_main and I wasn't sure if it's a right one.

tekguru 12-18-2007 09:39 AM

Cheers I was looking for a solution to this too!

AndrewD 12-18-2007 11:20 AM

Quote:

Originally Posted by Ron1213 (Post 1403466)
First of all, great hack.

I have problem adding some news in the main LDM page, which template should make a change to add some news about files (above categories, under LDM title). I saw link_main and I wasn't sure if it's a right one.

links_main is the right template.

You can either make the change in the template itself, or you can do it using a plugin which assigns the extra material to an entry in the '$includeinmain' array.

The template includes several 'placeholders', each of these refers to a specific entry in this array. You will find patterns like the following in the template:

Code:

<if condition="$includeinmain[precat]">
$includeinmain[precat]
</if>

The other entries in the array are called postcat, prefeat, postfeat, prelink, postlink, prestats and poststats

They appear in the logical order through the template.

derfelix 12-19-2007 12:29 PM

First.. it works great.. with 3.7 beta..

Second, i searched for multilanguage support.. for titles and descriptions.. and found somewhere in FAQ that it is not going to be supported..

So I came up with a very personal solution.. inspired by a very old hack by Joerg Z from the times where vbulletin 3.5 did not have the user profile fields phrased.. https://vborg.vbsupport.ru/showthread.php?t=98904

So i did some testing.. and it seems to work fine... but:

I only use l&d manager as a links database.. AND will never have more than 100 categories.. so i dont know what happens if it is used differently

What i'd be interested in.. is if someone knows if there is a drawback..

The principle:
When you create a cat, you enter a dummy name.. a placeholder with a dollar sign in front..
example for the category "Vbullentin Sites" you enter the name $vbull_sites_ll_name
- you do the same with description, and long description, paying attention that you have descriptive names.. example in our case: $vbull_sites_ll_desc and $vbull_sites_ll_long_desc

No special characters and no spaces in those names.. and a $ (dollar sign in front)

Now you create phrases for each entry name, description and long description..
They have to have the same varname as you entered for your category BUT without the $ dollar sign!!! .. .. in those phrases you enter the real text you want to have.. (you add those phrases in phrasemanager to group: local_links...

For this to work you need 2 file modifications..
1st..
open: local_links_include.php
and find:
PHP Code:

foreach ($linkscat as $catid => $thiscat) { 

below add:
PHP Code:

// language cats hack -------- start
    
$catname_multi trim($linkscat[$catid]['catname']);
    
$catdesc_multi trim($linkscat[$catid]['catdesc']);
    
$cattext_multi trim($linkscat[$catid]['cattext']);

    if(
substr($catname_multi,0,1) == '$' AND ($this_action != "addcat" OR $this_action != "editcat"))
    {
        
// we remove the '$'
        
$catname_multi substr($catname_multi,1);
        
// we get the phrase
        
$linkscat[$catid]['catname'] = (!empty($vbphrase[$catname_multi])) ? $vbphrase[$catname_multi] : $catname_multi;
    }
    if(
substr($catdesc_multi,0,1) == '$' AND ($this_action != "addcat" OR $this_action != "editcat"))
    {
        
// we remove the '$'
        
$catdesc_multi substr($catdesc_multi,1);
        
// we get the phrase
        
$linkscat[$catid]['catdesc'] = (!empty($vbphrase[$catdesc_multi])) ? $vbphrase[$catdesc_multi] : $catdesc_multi;
    }
    if(
substr($cattext_multi,0,1) == '$' AND ($this_action != "addcat" OR $this_action != "editcat"))
    {
        
// we remove the '$'
        
$cattext_multi substr($cattext_multi,1);
        
// we get the phrase
        
$linkscat[$catid]['cattext'] = (!empty($vbphrase[$cattext_multi])) ? $vbphrase[$cattext_multi] : $cattext_multi;
    }

// language cats hack -------- end 

then in the file local_links.php find:
PHP Code:

    $catname    htmlspecialchars_uni($linkscat[$viewcatid]["catname"]);
    
$catdesc    htmlspecialchars_uni($linkscat[$viewcatid]["catdesc"]);
    
$cattext    htmlspecialchars_uni($linkscat[$viewcatid]["cattext"]); 

and replace these 3 lines with:
PHP Code:

    // start multilang hack
    
$multilangcat $vbulletin->db->query_first("
        SELECT catname, catdesc, cattext
        FROM "
.THIS_TABLE."linkscat
        WHERE catid = '"
.$vbulletin->GPC['catid']."'
        "
);
    
//$catname    = htmlspecialchars_uni($linkscat[$viewcatid]["catname"]);
    
$catname $multilangcat['catname'];

    
//$catdesc    = htmlspecialchars_uni($linkscat[$viewcatid]["catdesc"]);
    
$catdesc $multilangcat['catdesc'];
    
//$cattext    = htmlspecialchars_uni($linkscat[$viewcatid]["cattext"]);
    
$cattext $multilangcat['cattext'];
    
// end multilang hack 

thats it...
as I said.. it seems to work.. and I will continue testing on my localhost as long as vb3.7 is still in beta...

What I'd be interested in... is if someone sees an obvious drawback...
Ok.. the cat editing is a pain.. but you do it only very seldomly.. (the extra query is only at catedit.. and only done by admin ==> me.. )

I forgot.. if the name or desc or long description do NOT start with a $ sign.. it works as designed for that cat.. so multilanguage is Not active for this cat..

I think its only a starting idea.. but surely needs to be overworked before usage..

Maybe there are better solutions.. but i didnt find any..
(more sophisticated would be to use the system vbull uses for user profile fields.. but that would require much more rewriting!!!) it basically does the same.. but creates the phrases when you enter the name.. and does the replacements in the background..

Felix

PS: this is just an idea i had while playing around.. it seems to work in my config.. but i would not use it in a production environment..

chickadee 12-19-2007 08:27 PM

Fantastic mod, just had a question:

What settings must I change if I want to create thumbnails of videos/images automatically?

Thanks so much Andrew, this mod is truly brilliant.

AndrewD 12-20-2007 03:38 AM

Quote:

Originally Posted by chickadee (Post 1404943)
Fantastic mod, just had a question:

What settings must I change if I want to create thumbnails of videos/images automatically?

Thanks so much Andrew, this mod is truly brilliant.

Currently it doesn't handle thumbnails of videos automatically, so you have to give the entry an associated image if you want something to appear.

For thumbnails of images, this is automatic - go to LDM/admin/settings/Controls on Images and Icons

Set link_imagesize to a non-zero value, and LDM will then automatically create thumbnails that size. You can use the other settings in this section to control whether the thumbs are cached, etc.

Do you know of a reliable tool for extracting the first frame/other frame from video files that works across servers? Does the imageimagic package do this?

Joep11 12-20-2007 03:51 PM

Hi Andrew,

How can I get the font size of the links larger? Tried some things but it did not work. See http://www.wereldwijzer.nl/local_links.php?catid=164

Still a great mod, thanks!

AndrewD 12-20-2007 08:00 PM

Quote:

Originally Posted by Joep11 (Post 1405535)
Hi Andrew,

How can I get the font size of the links larger? Tried some things but it did not work. See http://www.wereldwijzer.nl/local_links.php?catid=164

Still a great mod, thanks!

The links in the standard linkbit are styled with the legend style. You could either modify that style on the vb/admincp/styles or edit the links_linkbit template and apply another style.

coolgus 12-20-2007 08:32 PM

Andrew I'm facing a strange problem. It seems that many thumbnails from my entries are not showing. I can't find a pattern which causes this


All times are GMT. The time now is 11:34 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.02987 seconds
  • Memory Usage 1,786KB
  • 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
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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