vb.org Archive

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

vbboarder 07-10-2008 02:51 AM

To get the flash-sites plugin to work, do I need to enable allow_remote_downloads in LDM Settings? Also, do I need to enable the swf filetype in VB Attachment Manager?

AndrewD 07-10-2008 04:13 AM

Quote:

Originally Posted by derfelix (Post 1571364)
1. problem, using multiple styles..
(stupid me probably) i just want on the main page to have the folder icons for categories to be blue.. for the blue style and green for the green style..
as the category.png is somehow cached in the code.. i do not seem to be able to place a $stylevar to the imagefolder..

I understand. This is an omission on my part - the LDM icons are not style-dependent but can be category dependent. In fact, no one has asked for this before (in four years!!). Let me think about it.

Quote:

Originally Posted by derfelix (Post 1571364)
2. problem, same setup.. 6 categories (1.st level)
i have categories A, B, C, D, E and F

I have 2 categories per line
works fine if I have
A --- B
C --- D
E --- F
But if i change the display order.. using 1, 3, 5, 2, 6, 4
the layout (2 per line) is lost.. i can get it back by using 2x the same digit for displayorder.. i.e. 2,2, 3,3, 1,1
But i cant change from left to right..
hope that was clear.. if not i wanted to have the cats on the main page to be:
D --- C
F --- A
B --- E

but the closest i could get was
C --- D
A --- F
B --- E

(But that is not a major issue.. as i am doing a fresh setup anyway and will create the cats in the order i want)

Felix

Also understood. Display order over-rides everything else as far as the sorting goes, and forces a line break. Again, I will give this some thougbt, although I think it may be an inherent problem in the code design - i.e. if I fix this for you, then it may break other people's preferred layouts.

derfelix 07-10-2008 05:24 AM

Quote:

Originally Posted by AndrewD (Post 1571650)
I understand. This is an omission on my part - the LDM icons are not style-dependent but can be category dependent. In fact, no one has asked for this before (in four years!!). Let me think about it.

Well dont bother.. i just wanted to point it out.. as for me only the category icons need change.. i just added a stylevar in the code.. so it works for me.. as it is only 1 line i can port it for future releases. thx anyway

Quote:

Originally Posted by AndrewD (Post 1571650)
Also understood. Display order over-rides everything else as far as the sorting goes, and forces a line break. Again, I will give this some thougbt, although I think it may be an inherent problem in the code design - i.e. if I fix this for you, then it may break other people's preferred layouts.

Well as i said i can live with it.. as i have to do a brand new setup.. so dont waste your energies :D

because i would really need something for a product that is nearly finished. i.e. 3 extra hooks. The product is nearly finished.
What it does it allows you to have translated category titles and descriptions.
(I read in the FAQs that you dont plan to support that.. but i really wanted it)

It uses for the moment 3 plugins and 3 fileedits (that what i need the hooks for) and one template edit.
It uses the same translation system as the custom profile fields in vbulletin profile.
what it does:

creates custom phrases when adding or modifying category
deletes custom phrases when deleting category.
(this is done with plugins as there are nice hooks implemented)
When editing a category there is a link called "translations" besides the title and the description that opens the phrase editor with the phrase to translate.



what i'm still working on is the replacement of title and descriptions (still need one dropdown and wol)

If there is interest i will post the beta product here.. probably on sunday (cant work on it till then) (you can then check it out and decide if you think it would be worth it to add the hooks)

Felix

AndrewD 07-10-2008 07:13 AM

Quote:

Originally Posted by derfelix (Post 1571694)
Well dont bother.. i just wanted to point it out.. as for me only the category icons need change.. i just added a stylevar in the code.. so it works for me.. as it is only 1 line i can port it for future releases. thx anyway



Well as i said i can live with it.. as i have to do a brand new setup.. so dont waste your energies :D

because i would really need something for a product that is nearly finished. i.e. 3 extra hooks. The product is nearly finished.
What it does it allows you to have translated category titles and descriptions.
(I read in the FAQs that you dont plan to support that.. but i really wanted it)

It uses for the moment 3 plugins and 3 fileedits (that what i need the hooks for) and one template edit.
It uses the same translation system as the custom profile fields in vbulletin profile.
what it does:

creates custom phrases when adding or modifying category
deletes custom phrases when deleting category.
(this is done with plugins as there are nice hooks implemented)
When editing a category there is a link called "translations" besides the title and the description that opens the phrase editor with the phrase to translate.



what i'm still working on is the replacement of title and descriptions (still need one dropdown and wol)

If there is interest i will post the beta product here.. probably on sunday (cant work on it till then) (you can then check it out and decide if you think it would be worth it to add the hooks)

Felix

Thanks - I will gladly see how to integrate your ideas - Sunday will be difficult as it will be day 1 of being 'not normally conncted to internet' for several weeks.

Stilgar 07-10-2008 05:57 PM

Am I missing it? Is there a way to show all of the links on the main page? We don't have that many links and I want to display them all at once, yet still have them split into categories.

Thanks for any and all advice.

AndrewD 07-10-2008 06:15 PM

Quote:

Originally Posted by vbboarder (Post 1571608)
To get the flash-sites plugin to work, do I need to enable allow_remote_downloads in LDM Settings? Also, do I need to enable the swf filetype in VB Attachment Manager?

You should not need either of these - the add-in uses patterns to recognise each of the video sites.

I've re-tried the test file provided with the release, and found a couple of problems with the 2.2.9 releases.

- If you have the LDM setting local_file_root set, the addon does not work properly. There's a bug, fixed in the attached includes/local_links-players.php

- DailyMotion doesn't work any longer. I think the site has changed the url format.

AndrewD 07-10-2008 06:18 PM

Quote:

Originally Posted by Stilgar (Post 1572101)
Am I missing it? Is there a way to show all of the links on the main page? We don't have that many links and I want to display them all at once, yet still have them split into categories.

Thanks for any and all advice.

You could turn on one of the LDM statistics options - e.g. newest entries, and set the number to display to more than the total entries.

Stilgar 07-10-2008 06:35 PM

Thanks for that, Andrew.

That looks ok, but I really want to see the complete Link entries listed on the main page. I think my real problem is I have not yet explored the Category Display Settings properly. I had better get with it. ;)

obmob 07-10-2008 07:32 PM

Icons dependent of styles would be great... if possible :p

derfelix 07-10-2008 09:09 PM

ok.. as promised.. here are the 2 hacks..
ATTENTION.. this is very beta... and straight forward.. only apply if you know what you are doing!!!


1. the styledependent category icons.. (its a file edit and the category icons ONLY!!)
open includes/local_links_include.php
find:
PHP Code:

$iconnew_setting ldm_lookup_setting($catid'cat_icon_new'); 

below add:
PHP Code:

    //xba iconcache
    
$ldm_icon_cache['category_new'] = $stylevar['imgdir_misc'] . '/ldm/' 'category_new.png';
    
$ldm_icon_cache['category'] = $stylevar['imgdir_misc'] . '/ldm/' 'category.png'

save the file.

then create a "ldm" directory in the misc image directory of your style... (in every style)
into that directory copy "category_new.png" and "category.png" corresponding to the style..
that was all i needed..

------------------

2. multi language category titles and descriptions..

Ok this is more complicated..
1 product (see attachment)
what the product does:
every time you create a category or you modify a category title or description, it creates a 2 custom phrase.
it inserts your title (the one you created or modified the "normal" way as custom phrase in masterlanguage.
the name of the title-phrase will be
$vbphrase[ll_cat_catid_title]
in the vbulletin phrasemanager you can then add translations to that phrase..
IF you modify the title (as u usually do) the phrase gets overwritten in masterlanguage
IF you delete the category the phrase gets deleted.

It also adds a "Translations" link below "Category name" and "Category description" and the phrase: Translations

--------- ok thats the product... the hooks where there in the ideal places.


Now the fileedits... (they are in locations where i did not find any hooks)

open includes/local_links_include.php
find:
PHP Code:

$child[$linkscat[$k]['parentid']][] = $k

below add:
PHP Code:

        //xba multilang dropdown
        
if(!empty($vbphrase['ll_cat_' $k '_title']))
        {
            
$linkscat[$k]['catname'] = $linkscat[$k]['catname_clean'] = htmlspecialchars_uni($vbphrase['ll_cat_' $k '_title']);
        }
        
//xba multilang dropdown end 

then find:
PHP Code:

$catid    $thiscat["catid"]; 

below add:
PHP Code:

        //xba multilang on main page
            
if(!empty($vbphrase['ll_cat_' $catid '_title']))
            {
                
$thiscat["catname"] = $vbphrase['ll_cat_' $catid '_title'];
            }
            if(!empty(
$vbphrase['ll_cat_' $catid '_desc']))
            {
                
$thiscat["catdesc"] = $thiscat["cattext"] = $vbphrase['ll_cat_' $catid '_desc'];

            }
        
//xba multilang on main page end 

save local_links_include.php

then open: includes/local_links_profile.php
find:

PHP Code:

        $thislinkid = -1;
        while (
$myrow $vbulletin->db->fetch_array($rec)) { 

below add:
PHP Code:

        //xba multilang
            
if(!empty($vbphrase['ll_cat_' $myrow['catid'] . '_title']))
            {
                
$myrow['catname'] = $vbphrase['ll_cat_' $myrow['catid'] . '_title'];

            }
        
//xba multilang end 

save: local_links_profile.php

and finally open the main local_links.php in the vbulletin directory

find:
PHP Code:

        if ($links_defaults['sync_enabled'] and $linkscat[$viewcatid]['catsyncdir']) {
            require_once(
DIR '/includes/local_links_misc.php');
            
$resync $vbulletin->GPC['resync'];
            
ldm_synchronise_category($viewcatidiif($resync$links_defaults['sync_maxcpu_allowed_manual'], $links_defaults['sync_maxcpu_allowed']), $resync);
        } 

below add:
PHP Code:

        //xba multilang on main page
            
if(!empty($vbphrase['ll_cat_' $viewcatid '_title']))
            {
                
$linkscat["$viewcatid"]["catname"] = $vbphrase['ll_cat_' $viewcatid '_title'];
                
$linkscat["$viewcatid"]["catname_clean"] =  htmlspecialchars_uni($vbphrase['ll_cat_' $viewcatid '_title']);
            }
            if(!empty(
$vbphrase['ll_cat_' $viewcatid '_desc']))
            {
                
$linkscat["$viewcatid"]["cattext"]=$linkscat["$viewcatid"]["catdesc"] = $vbphrase['ll_cat_' $viewcatid '_desc'];

            }
        
//xba multilang end 

save: local_links.php

Don't forget to import the product...

ATTENTION: This will only work if you have more than 1 language installed in vbulletin. At least 2 languages must exist!!!! if you have only 1 language installed.. it will do nothing!!!
AND .. you will only see the translations after you actually translated the phrases ;)

IF you have existing categories.. clicking the "translations" link will give: phrase does not exist.
In that case.. just hit the submit button on the Add/Edit Category page. Then only the phrase is created and then you will get the phrase when clicking the translations link. This has to be done once for every existing category. When creating a new category you also have to save it. Then only the translations link gets you to the phrase.


Todo:
verify if the phrase replacements are needed in other places..
for the moment it works in main page, category pages ( the dropdown is also translated) and in the search page.. (I did not test the profile page but added the translation)

thats it..

I hope this is usefull for someone.. and if there were hooks.. that would save the file edits..

-------------

PS @ andrew
Just got a great fright... when editing a template i somehow seen that there were no sessionurls in the links.. (in the office.. they have disabled cookies on our browsers :( ) which meens that i get logged out each link i click.. i meen if for example i go to page 2.. i get logged out :(
I didnt have the time to check all the templates and all the files.


All times are GMT. The time now is 02:56 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.04791 seconds
  • Memory Usage 1,829KB
  • 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_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (5)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