View Single Post
  #14  
Old 09-14-2012, 08:42 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is out of one of my ad mods
PHP Code:
if ($this->registry->options['google_ads_onoff'] && ($this->registry->options['advert_postbit_ad'] || $this->registry->options['advert_postbit_ad_rand']))
{


    
$this_script_off explode('|',$this->registry->options['advert_this_script_off']);
    if (!
$this->registry->options['advert_this_script_off'] || !in_array(THIS_SCRIPT$this_script_off))
    {
        
$post[posts] = str_replace('|'''$post[posts]);
        if (!
$this->registry->options['advert_maxuserpostcount'] || $post[posts] < $this->registry->options['advert_maxuserpostcount'])  
        {    
            
$adtitle $this->registry->options['advert_adtitle'];
        
            if (
$this->registry->options['advert_removeadstext'] && $this->registry->options['advert_removeadslink'])
            {
                
$removeadstext $this->registry->options['advert_removeadstext'];
                
$removeadslink $this->registry->options['advert_removeadslink'];
                
$removeads '<span style="float:' $stylevar[right] . ';font-weight:normal;"><a href="' $removeadslink '">' $removeadstext '</a></span>';
            }
            
            if (
$this->registry->options['advert_postbit_ad'])
            {
                
$postbit_ad $this->registry->options['advert_postbit_ad'];
            }
            else if (
$this->registry->options['advert_postbit_ad_rand'])
            {
                
$postbit_ad explode('|',$this->registry->options['advert_postbit_ad_rand']);
                
$postbit_rand array_rand($postbit_ad);
                
$postbit_ad $postbit_ad[$postbit_rand];
            }    
            
            if (
$this->registry->options['advert_avatar'])
            {
                
$advert_avatar '<img src="' $this->registry->options['advert_avatar'] . '" border="0" class="inlineimg" alt="" />';
            }    
            
            if (
$this->registry->options['legacypostbit'])
            {
                
$advert_postbit_template ad_postbit_legacy_end;
                if (
$this->registry->options['advert_postbitasuser'])
                {
                    
$postbit_advert_asuser '<td class="alt2" width="175px"><div><a class="bigusername" href="javascript:;" rel="nofollow">' $this->registry->options['bbtitle'] . '</a></div><div class="smallfont">Advertisement</div><div>&nbsp;<br />' $advert_avatar '</div></td>';
                }
            }
            else
            {    
                
$advert_postbit_template ad_postbit_below;
                
                if (
$this->registry->options['advert_postbitasuser'])
                {
                    
$postbit_advert_asuser '<tr><td class="alt2" style="padding:0;"><table cellpadding="' $stylevar[cellpadding] . '" cellspacing="' $stylevar[cellpadding] . '" border="0" width="100%"><tr><td style="padding:0;">' $advert_avatar '</td><td nowrap="nowrap" width="100%"  style="padding:0;"><div><a class="bigusername" href="javascript:;" rel="nofollow">' $this->registry->options['bbtitle'] . '</a></div><div class="smallfont">Advertisement</div></td></tr></table></td></tr>';
                }
            }
            
            
$adusergroupinfo_on explode('|',$this->registry->options['advert_Postbit_usergroups_on']);
            
$adusergroupinfo_off explode('|',$this->registry->options['advert_Postbit_usergroups_off']);
            if ((!
$this->registry->options['advert_Postbit_usergroups_on'] || is_member_of($this->registry->userinfo$adusergroupinfo_on)) && !is_member_of($this->registry->userinfo$adusergroupinfo_off))
            {
                
$aduserinfo_on explode('|',$this->registry->options['advert_userids_on']);
                
$aduserinfo_off explode('|',$this->registry->options['advert_userids_off']);
                if ((!
$this->registry->options['advert_userids_on'] || !in_array($userinfo[userid], $aduserinfo_on)) && in_array($userinfo[userid], $aduserinfo_off))
                {
                    
                    if (
$this->registry->options['advert_pms_onoff'] && THIS_SCRIPT == 'private')
                    {
                        eval(
'$ad_postbit_below = "' fetch_template('' $advert_postbit_template '') . '";');
                    }
                    
                    else if (
$this->registry->options['advert_announcements_onoff'] && THIS_SCRIPT == 'announcement')
                    {
                        
                        
$adforuminfo_on explode('|',$this->registry->options['advert_forumids_on']);
                        
$adforuminfo_off explode('|',$this->registry->options['advert_forumids_off']);
                        if ((!
$this->registry->options['advert_forumids_on'] || !in_array($foruminfo[forumid], $adforuminfo_on)) && in_array($foruminfo[forumid], $adforuminfo_off))
                        {
                            
$adannouncementinfo_on explode('|',$this->registry->options['advert_announcementids_on']);
                            
$adannouncementinfo_off explode('|',$this->registry->options['advert_announcementids_off']);
                            if ((!
$this->registry->options['advert_announcementids_on'] || in_array($post[postid], $adannouncementinfo_on)) && !in_array($post[postid], $adannouncementinfo_off))
                            {    
                                eval(
'$ad_postbit_below = "' fetch_template('' $advert_postbit_template '') . '";');
                            }
                        }
                    }
                    
                    else if (
$this->registry->options['advert_posts_onoff'] && (THIS_SCRIPT == 'showthread' || THIS_SCRIPT == 'showpost'))
                    {
                        
$adforuminfo_on explode('|',$this->registry->options['advert_forumids_on']);
                        
$adforuminfo_off explode('|',$this->registry->options['advert_forumids_off']);
                        if ((!
$this->registry->options['advert_forumids_on'] || in_array($thread[forumid], $adforuminfo_on)) && !in_array($thread[forumid], $adforuminfo_off))
                        {
                            
$adthreadinfo_on explode('|',$this->registry->options['advert_threadids_on']);
                            
$adthreadinfo_off explode('|',$this->registry->options['advert_threadids_off']);
                            if ((!
$this->registry->options['advert_threadids_on'] || in_array($thread[threadid], $adthreadinfo_on)) && !in_array($thread[threadid], $adthreadinfo_off))
                            {
                                
$post[posts] = str_replace('|'''$post[posts]);
                                if ((!
$this->registry->options['advert_minpostcount'] || $GLOBALS[threadinfo][replycount] >= ($this->registry->options['advert_minpostcount'] - 1)) && (!$this->registry->options['advert_maxuserpostcount'] || $post[posts] < $this->registry->options['advert_maxuserpostcount']))  
                                {    
                                    
$adxpostonly explode('|',$this->registry->options['advert_xpostonly']);
                                    if ((
$this->registry->options['advert_firstpost'] && $post[postcount] % $this->registry->options[maxposts] == 1) || ($this->registry->options['advert_lastpost'] && $post['islastshown']) || ($this->registry->options['advert_postcountrepeat'] && $post[postcount] % $this->registry->options['advert_postcountrepeat'] == 0) || ($this->registry->options['advert_xpostonly'] && $post[postcount] == in_array($post[postcount], $adxpostonly)))
                                    {                    
                                        eval(
'$ad_postbit_below = "' fetch_template('' $advert_postbit_template '') . '";');
                                    }
                                }
                            }
                        }
                    }
                }
            }    
        }
    }

It may help you figure stuff out
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01468 seconds
  • Memory Usage 1,936KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete