Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Sections for logged in users in GTCustom Pages Details »»
Sections for logged in users in GTCustom Pages
Version: 1.00, by hamidof hamidof is offline
Developer Last Online: Sep 2012 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.x Rating:
Released: 08-04-2007 Last Update: Never Installs: 4
 
No support by the author.

This mod modifies GTCustom Pages, you can download it here:
https://vborg.vbsupport.ru/showthread.php?t=108583

More information here:
https://vborg.vbsupport.ru/showthread.php?t=108586

I was working on a quick project and there was 3 buy now buttons that needed to show up only for members who are logged in.
With a little modification to this hack you can do this:

First find or download goto.php that comes with this package and open it with your favourite text editor.
Find:
PHP Code:
               /* 
    * *************************************
    * PHRASES - no need to parse
    * **************************************
    */
    
$vbphrase['content'] = $vbphrase['gtcustom_' $section];
    
$vbphrase['header_title'] = $vbphrase['gtcustom_' $section '_header'];
    
$vbphrase['sub_title'] = $vbphrase['gtcustom_' $section '_subtitle']; 
It starts at line: 70
Add these lines after them:

PHP Code:
    /**
     * User logged in stuff
     * By Codehead @ talk.code-head.com
    **/ 
    
if( isset($vbphrase['gtcustom_' .$section .'_user_not_logged_in']) && strlen($vbphrase['gtcustom_' .$section .'_user_not_logged_in']) > && !$vbulletin->userinfo['userid'] ) {
        
$regex                     '#__START_USER_SECTION__.*?__END_USER_SECTION__#is';
        
$vbphrase['content'] = preg_replace($regex$vbphrase['gtcustom_' .$section .'_user_not_logged_in'], $vbphrase['content']);
    } else { 
        
$regex                    = array('#__START_USER_SECTION__#i''#__END_USER_SECTION__#i');
        
$vbphrase['content'] = preg_replace($regex''$vbphrase['content']);
    } 
So all together it will look like this:
PHP Code:
    /* 
    * *************************************
    * PHRASES - no need to parse
    * **************************************
    */
    
$vbphrase['content'] = $vbphrase['gtcustom_' $section];
    
$vbphrase['header_title'] = $vbphrase['gtcustom_' $section '_header'];
    
$vbphrase['sub_title'] = $vbphrase['gtcustom_' $section '_subtitle'];
    
    
/**
     * User logged in stuff
     * By Codehead @ talk.code-head.com
    **/ 
    
if( isset($vbphrase['gtcustom_' .$section .'_user_not_logged_in']) && strlen($vbphrase['gtcustom_' .$section .'_user_not_logged_in']) > && !$vbulletin->userinfo['userid'] ) {
        
$regex                     '#__START_USER_SECTION__.*?__END_USER_SECTION__#is';
        
$vbphrase['content'] = preg_replace($regex$vbphrase['gtcustom_' .$section .'_user_not_logged_in'], $vbphrase['content']);
    } else { 
        
$regex                    = array('#__START_USER_SECTION__#i''#__END_USER_SECTION__#i');
        
$vbphrase['content'] = preg_replace($regex''$vbphrase['content']);
    } 
Upload it back to your server.

Then you need another phrase called:
gtcustom_YOUR_CUSTOM_PAGE_user_not_logged_in

And put the text for when the user is not logged in or not a memeber, for instance:
(HTML alowed)

HTML Code:
You must be logged in to purchase this item.<br />
Please take a moment to login or register.
Then in your gtcustom_YOUR_CUSTOM_PAGE phrase wrap the sections in __START_USER_SECTION__ & __END_USER_SECTION__ for instance:

HTML Code:
Some info about the item that you want to sell...
__START_USER_SECTION__
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
...
</form>
__END_USER_SECTION__

Some other item info...
__START_USER_SECTION__
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
...
</form>
__END_USER_SECTION__
You can have multiple sections for logged in users and if they are not logged in, the text in gtcustom_YOUR_CUSTOM_PAGE_user_not_logged_in will be shown.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-05-2007, 01:57 PM
radarhunter radarhunter is offline
 
Join Date: Jul 2006
Location: Punjab, India
Posts: 315
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font color="Red">*Reserved*</font>
Reply With Quote
  #3  
Old 08-05-2007, 02:14 PM
Deepdog009's Avatar
Deepdog009 Deepdog009 is offline
 
Join Date: Dec 2004
Location: Almost out of PHP TZone
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've recently dabbled in the custom page realm and I think this may assist me a bit here and there...

Time & Effort on this deserves a click and vote...

P.S ....>>> screenshots with your additions?
Reply With Quote
  #4  
Old 08-05-2007, 02:30 PM
beduino's Avatar
beduino beduino is offline
 
Join Date: Dec 2005
Location: Rio de Janeiro
Posts: 280
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tks for share!
all the best
beduino
Reply With Quote
  #5  
Old 08-05-2007, 08:18 PM
rooban12 rooban12 is offline
 
Join Date: May 2007
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks a lot ----- need screen shots
Reply With Quote
  #6  
Old 08-14-2007, 06:37 PM
Forumi Shqiptar's Avatar
Forumi Shqiptar Forumi Shqiptar is offline
 
Join Date: Aug 2005
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

screenshots will be nice please
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08060 seconds
  • Memory Usage 2,277KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_html
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete