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)

obmob 10-04-2007 03:10 PM

Quote:

Originally Posted by AndrewD (Post 1352279)
This is possible but requires changes to the code. It is something that I have intended to make easily available via the LDM/admin pages at some stage, but never quite finished.

Basically, you do the following:

- create a new template within your vbulletin/admincp, for example called links_mylinkbit
- edit includes/local_links_admininclude.php
- find a group of lines (around line 550) which look like this:

PHP Code:

require_admin_row($seq++, 'links_linkbit'serialize(array("name"=>"Modern""collapse"=>"links_linkbit_short""defcol"=>1"maxcol"=>1"altbit"=>0)), 'define_linkbit'1); 

- add a new line with slightly changed values, e.g.

PHP Code:

require_admin_row($seq++, 'links_mylinkbit'serialize(array("name"=>"My Linkbit""collapse"=>"links_linkbit_short""defcol"=>1"maxcol"=>1"altbit"=>0)), 'define_linkbit'1); 

- if you take a look at the comments in the code, you can probably work out what the other parameters do.

- re-install the LDM product installer.
- the new template will then be available in the same way as other LDM linkbits

OK?

Good, good, thanks, i will try it with the latest 2.2.8 :D

Thanks IrPR, not a bad idea, but i think it's easier to edit some files :p

fredang85 10-04-2007 04:53 PM

When i activate one of the blocks for vbadvanced, this is what I get.

http://www.motorolafans.com/index.php?pageid=downloads

How do I solve this problem?

AndrewD 10-04-2007 06:17 PM

Quote:

Originally Posted by fredang85 (Post 1352932)
When i activate one of the blocks for vbadvanced, this is what I get.

http://www.motorolafans.com/index.php?pageid=downloads

How do I solve this problem?

well, i think that error message says that you've created a link pointing to a module on a vbadvanced page called downloads, and the page no longer exists. I think this is probably an error on your vbadvanced setup.

Alfa1 10-04-2007 09:32 PM

Since I have changed tabs some time ago, I am not using the tabbars hack, but have just put the conditionals in my navbar and have added the following to my additional CSS definitions:
Code:

td.tab a:link,td.tab a:visited,td.tab a:active,a.tab,
td.tab2 a:link,td.tab2 a:visited,td.tab2 a:active,a.tab2,a:link.tab2,a:active.tab2,a:visited.tab2{
background:transparent url(http://www.mysite.com/test/images/tabc.gif) top right no-repeat;
font:12px tahoma,sans-serif;
width:71px;
height:24px;
text-align:center;
padding:3px 0 0;
margin:0 1px;
text-decoration:none;
float:right;
position:relative;
top:3px
}
td.tab a:hover,img.tab a:hover,.tab a:hover,a:hover.tab,
td.tab2 a:link,td.tab2 a:visited,td.tab2 a:active,a.tab2,a:link.tab2,a:active.tab2,a:visited.tab2{
background:transparent url(http://www.mysite.com/test/images/tab2c.gif) top right no-repeat;
}

Quote:

Originally Posted by AndrewD (Post 1350607)
Yes, there's a small problem with this approach, because the standard coding for the tabs hack sets up its display *before* LDM gets started. Consequently, standard LDM variables have not yet been set.

The following approach works:

1) Instead of putting $tabbars in the navbar template, put it in the links_header template, immediately after $navbar.
2) Create a new plugin tied to the *ldm_maindisplay_end* hook, and make its code identical to the code which the tabs hack ties to the *parse_templates* hook
3) You can code your in_array() check using the $viewcatid variable.

This will work for the main LDM displays. You will have to work out how to get this to work in other parts of vBulletin, i.e. which templates you can patch with $tabbars, etc.

- How would this translate to my current set up?

- Am I correct to use the $viewcatid variable like this? This is how I currently have conditionals in my navbar:
PHP Code:

<if condition="$show['member']">
 <
table cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center" style="border-bottom-width:0px;color:white;">
  <
tr>
    <
td class="nowrap" align="right" valign="center" style="padding:0px 20px 0;color:white">

<if 
condition="in_array($viewcatid[catid], array(126,39, 43))"><a href="http://www.mysite.com/test/local_links.php?catid=126" title="Watch video's" id="mytab" class="tab2">Video</a><else /><a href="http://www.mysite.com/test/local_links.php?catid=126" title="Watch video's" id="mytab" class="tab">Video</a></if>
<if 
condition="in_array($viewcatid[catid], array(127,42, 61))"><a href="http://www.mysite.com/test/local_links.php?catid=127" title="Listen to podcasts, music" id="mytab" class="tab2">Audio</a><else /><a href="http://www.mysite.com/test/local_links.php?catid=127" title="Listen to podcasts, music " id="mytab" class="tab">Audio</a></if>
<if 
condition="in_array($viewcatid[catid], array(1 , 2, 3, 4 ,5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150))"><a href="http://www.mysite.com/test/local_links.php" title="Read research & information" id="mytab" class="tab2">Documents</a><else /><a href="http://www.mysite.com/test/local_links.php" title="Read research & information" id="mytab" class="tab">Documents</a></if>

  </
tr></table>
</if> 


fredang85 10-04-2007 11:02 PM

Quote:

Originally Posted by AndrewD (Post 1352981)
well, i think that error message says that you've created a link pointing to a module on a vbadvanced page called downloads, and the page no longer exists. I think this is probably an error on your vbadvanced setup.

When I disactivate the block, "Whats new", the page displays correctly, but when I activate it, this shows up.

I've tried with other blocks that came with the LDM and all's the same.

AndrewD 10-05-2007 03:49 AM

Quote:

Originally Posted by fredang85 (Post 1353162)
When I disactivate the block, "Whats new", the page displays correctly, but when I activate it, this shows up.

I've tried with other blocks that came with the LDM and all's the same.

I've not seen this problem before, so I don't know what to suggest, but I'm happy to take a look at your site and try to fix it. If you want this, send me a PM with site details and an account/password with vb admin privs.

AndrewD 10-05-2007 03:55 AM

Quote:

Originally Posted by Alfa1 (Post 1353106)
Since I have changed tabs some time ago, I am not using the tabbars hack, but have just put the conditionals in my navbar and have added the following to my additional CSS definitions:
Code:

td.tab a:link,td.tab a:visited,td.tab a:active,a.tab,
td.tab2 a:link,td.tab2 a:visited,td.tab2 a:active,a.tab2,a:link.tab2,a:active.tab2,a:visited.tab2{
background:transparent url(http://www.mysite.com/test/images/tabc.gif) top right no-repeat;
font:12px tahoma,sans-serif;
width:71px;
height:24px;
text-align:center;
padding:3px 0 0;
margin:0 1px;
text-decoration:none;
float:right;
position:relative;
top:3px
}
td.tab a:hover,img.tab a:hover,.tab a:hover,a:hover.tab,
td.tab2 a:link,td.tab2 a:visited,td.tab2 a:active,a.tab2,a:link.tab2,a:active.tab2,a:visited.tab2{
background:transparent url(http://www.mysite.com/test/images/tab2c.gif) top right no-repeat;
}



- How would this translate to my current set up?

- Am I correct to use the $viewcatid variable like this? This is how I currently have conditionals in my navbar:
PHP Code:

<if condition="$show['member']">
 <
table cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center" style="border-bottom-width:0px;color:white;">
  <
tr>
    <
td class="nowrap" align="right" valign="center" style="padding:0px 20px 0;color:white">

<if 
condition="in_array($viewcatid[catid], array(126,39, 43))"><a href="http://www.mysite.com/test/local_links.php?catid=126" title="Watch video's" id="mytab" class="tab2">Video</a><else /><a href="http://www.mysite.com/test/local_links.php?catid=126" title="Watch video's" id="mytab" class="tab">Video</a></if>
<if 
condition="in_array($viewcatid[catid], array(127,42, 61))"><a href="http://www.mysite.com/test/local_links.php?catid=127" title="Listen to podcasts, music" id="mytab" class="tab2">Audio</a><else /><a href="http://www.mysite.com/test/local_links.php?catid=127" title="Listen to podcasts, music " id="mytab" class="tab">Audio</a></if>
<if 
condition="in_array($viewcatid[catid], array(1 , 2, 3, 4 ,5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 40, 41, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150))"><a href="http://www.mysite.com/test/local_links.php" title="Read research & information" id="mytab" class="tab2">Documents</a><else /><a href="http://www.mysite.com/test/local_links.php" title="Read research & information" id="mytab" class="tab">Documents</a></if>

  </
tr></table>
</if> 


It's a bit difficult to help at a distance. $viewcatid is a variable, not an array, so you should make the test something like in_array($viewcatid, array (1,2,3,4,5)). If you've put this into the navbar template rather as plugins a la tabbar hack, this should work correctly within LDM. $viewcatid will be undefined outside LDM, so the test would give the answer 'false' in other parts of the board and not cause an error.

Willygsm 10-05-2007 09:38 AM

hi AndrewD, i have try to set the limit for a user and bytes but the user still can download as many as he can.. please let me know any setting need to set?

here is the screenshot,

AndrewD 10-05-2007 09:41 AM

Quote:

Originally Posted by Willygsm (Post 1353357)
hi AndrewD, i have try to set the limit for a user and bytes but the user still can download as many as he can.. please let me know any setting need to set?

here is the screenshot,

Up to version 2.2.7, LDM will only apply limits for entries that it recognises as downloads, and this requires that you have a valid mimetype entry for the filetype in the vbulletin/admn/attachments table. You should check this first. For .exe files, mimtype of "Content-type: application/download" should do the job.

Willygsm 10-05-2007 10:15 AM

Quote:

Originally Posted by AndrewD (Post 1353359)
Up to version 2.2.7, LDM will only apply limits for entries that it recognises as downloads, and this requires that you have a valid mimetype entry for the filetype in the vbulletin/admn/attachments table. You should check this first. For .exe files, mimtype of "Content-type: application/download" should do the job.

hi andrew thanks for reply, after set exe on attachment table. now when i try download, it show me , please look at the attachment.


All times are GMT. The time now is 11:33 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.05127 seconds
  • Memory Usage 1,827KB
  • 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_code_printable
  • (4)bbcode_php_printable
  • (8)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