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)

Natch 04-20-2004 09:22 AM

As AndrewD said, the code I wrote ignores the permissions deliberately. It is a teaser so that unregistered users, or users without permission do not see an Empty Box in your portal, but see the links. If they decide to try and download, they get told they do not have permission, and if unregistered they are prompted to register.

This seemd to me to be the cleanest way to do it - I can test the altered get_hotlinks.php code and get back to you on how it looks, but my guess is that it will not be as clean on your portal page.

Quote:

Originally Posted by pseudocode
Great hack!! I'm having some difficulty though. I'm sure I'm just missing something. The only thing that displays for me is "alt2" in the box on the portal page. What am I missing? I've gone back over my changes several times. Thanks in advance for your help!

I do not know what might be causing your error - but as AndrewD said as well, it sounds like a template error to me.

lasto 04-20-2004 09:42 AM

i installed this links database yesterday and then installed your addon Natch and it worked first time.It shows me the top 5 downloads.

Well done to both of u for a good hack :)

Natch 04-20-2004 10:43 AM

Quote:

Originally Posted by Natch
As AndrewD said, the code I wrote ignores the permissions deliberately. It is a teaser so that unregistered users, or users without permission do not see an Empty Box in your portal, but see the links. If they decide to try and download, they get told they do not have permission, and if unregistered they are prompted to register.

This seemd to me to be the cleanest way to do it - I can test the altered get_hotlinks.php code and get back to you on how it looks, but my guess is that it will not be as clean on your portal page.



I do not know what might be causing your error - but as AndrewD said as well, it sounds like a template error to me.

I've tested the updated [permissions-based] get_hotlinks.php file with my board, and the only question I have [for AndrewD] is what is returned if there are no links available for the user to view ?

It does work by reducing the links that the Guest / limited access usr can see in the CustomBox, but what happens if the number of returned links is zero (0) ?

AndrewD 04-20-2004 11:04 AM

Quote:

Originally Posted by Natch
I've tested the updated [permissions-based] get_hotlinks.php file with my board, and the only question I have [for AndrewD] is what is returned if there are no links available for the user to view ?

It does work by reducing the links that the Guest / limited access usr can see in the CustomBox, but what happens if the number of returned links is zero (0) ?

My impression, looking at the code, is that get_hotlinks() will just return a null string. If this is problematic, it could be fixed by modifing the vbindex_custom template, e.g. (not sue if my syntax is correct)

PHP Code:

<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%"
    <
tr
        <
td
            <
table cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%"
                <
tr
                    <
td colspan="2" class="tcat" style="text-align: center"
                        <
a name="hotties" style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$boxsrc="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a
                        <
strong><a href="$vboptions[bburl]/local_links.php" title="Visit the Downloads section">Hottest Downloads</a></strong
                    </
td
                </
tr
                <
tbody id="collapseobj_vbindex_customblock$boxstyle="$collapseobj_vbindex_customblock"
<if 
condition="$hotlinks">$hotlinks<else />There are no downloads available to you</if>
                </
tbody
            </
table
        </
td
    </
tr
</
table
<
br /> 


Natch 04-20-2004 11:20 AM

Quote:

Originally Posted by AndrewD
My impression, looking at the code, is that get_hotlinks() will just return a null string. If this is problematic, it could be fixed by modifing the vbindex_custom template, e.g. (not sue if my syntax is correct)

PHP Code:

<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%"
    <
tr
        <
td
            <
table cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%"
                <
tr
                    <
td colspan="2" class="tcat" style="text-align: center"
                        <
a name="hotties" style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$boxsrc="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a
                        <
strong><a href="$vboptions[bburl]/local_links.php" title="Visit the Downloads section">Hottest Downloads</a></strong
                    </
td
                </
tr
                <
tbody id="collapseobj_vbindex_customblock$boxstyle="$collapseobj_vbindex_customblock"
<if 
condition="$hotlinks">$hotlinks<else />There are no downloads available to you</if>
                </
tbody
            </
table
        </
td
    </
tr
</
table
<
br /> 


Looks good to me ! :) I'm happy to roll-up my hack into yours with this facility and be logged for support in the one place (if you are OK with that ?)

r00t3d 04-20-2004 01:07 PM

Quote:

Originally Posted by AndrewD
My impression, looking at the code, is that get_hotlinks() will just return a null string. If this is problematic, it could be fixed by modifing the vbindex_custom template, e.g. (not sue if my syntax is correct)

PHP Code:

<table cellpadding="0" cellspacing="0" border="0" class="tborder" width="100%"
    <
tr
        <
td
            <
table cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%"
                <
tr
                    <
td colspan="2" class="tcat" style="text-align: center"
                        <
a name="hotties" style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('vbindex_customblock$box')"><img id="collapseimg_vbindex_customblock$boxsrc="$stylevar[imgdir_button]/collapse_tcat$collapseimg_vbindex_customblock.gif" alt="" border="0" /></a
                        <
strong><a href="$vboptions[bburl]/local_links.php" title="Visit the Downloads section">Hottest Downloads</a></strong
                    </
td
                </
tr
                <
tbody id="collapseobj_vbindex_customblock$boxstyle="$collapseobj_vbindex_customblock"
<if 
condition="$hotlinks">$hotlinks<else />There are no downloads available to you</if>
                </
tbody
            </
table
        </
td
    </
tr
</
table
<
br /> 


would this be the same for vbadvanced homepage v1.1?

AndrewD 04-20-2004 04:09 PM

Quote:

Originally Posted by Natch
Looks good to me ! :) I'm happy to roll-up my hack into yours with this facility and be logged for support in the one place (if you are OK with that ?)

I'm happy with this. Why don't we do the following -

I'll make a minor change to the basic hack to add a new set of permissions via the admin page (e.g. can_see_links). Usergroups with this setting will be able to *see* (but not necessarily access) links via the portals.

I'll update get_hotlinks.php to use this setting and the forums permission checking.

We'll roll the two hacks together, with you flagged for support.

I'll also contact the vbadvanced thread to see if we can get the same approach taken on board there.

This may take me a few days, as I'm away on two business trips from tomorrow for a week.

AndrewD 04-20-2004 04:09 PM

Quote:

Originally Posted by r00t3d
would this be the same for vbadvanced homepage v1.1?

I imagine so.

Natch 04-21-2004 12:54 AM

Quote:

Originally Posted by AndrewD
I'm happy with this. Why don't we do the following -

I'll make a minor change to the basic hack to add a new set of permissions via the admin page (e.g. can_see_links). Usergroups with this setting will be able to *see* (but not necessarily access) links via the portals.

I'll update get_hotlinks.php to use this setting and the forums permission checking.

We'll roll the two hacks together, with you flagged for support.

I'll also contact the vbadvanced thread to see if we can get the same approach taken on board there.

This may take me a few days, as I'm away on two business trips from tomorrow for a week.

Sounds good to me - once it's finalised, I'll edit the other thread to point to here for all support, or maybe see if the two threads can be merged ...

Thanks man - your work is excellent :)

ChrisSy 04-21-2004 08:29 AM

does this also support attachments in filesystem rather than database? an also is there a way of importing old attachments into this links area

thanks


All times are GMT. The time now is 09:43 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.02099 seconds
  • Memory Usage 1,808KB
  • 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
  • (3)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
  • (3)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