vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

SavSin 01-16-2012 06:50 AM

The page should look like this.
http://www.xvgaming.com/games/stats/bfstats.php
And here is the (second page) using this article to create the template
http://www.xvgaming.com/bfstatsbynam...M_0:0:21788544

Here is the php file (standalone) that makes it like bfstats.php

PHP Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <LINK REL=StyleSheet HREF="bfstats.css" TYPE="text/css">
</head>

<body>

<div id="wrapper">

<div id="branding">
    <a href="http://www.xvgaming.com/">
        <img src="http://www.xvgaming.com/images/xvgaming/xvgaming_logo2.png" alt="Logo">
    </a>    
</div>

<div id="navbar">
    <ul>
        <li class="homeborder"><a href="http://www.xvgaming.com/">Home</a></li>
        <li class="selected"><a href="http://www.xvgaming.com/forum.php">Forum</a></li>
        <li><a href="http://shop.xvgaming.com/">Shop</a></li>
    </ul>
</div>

<div id="lowerbranding">
&nbsp;
</div>

<div id="container">

    <div id="navlinks">

        <a href="http://www.xvgaming.com"><img src="http://www.xvgaming.com/images/xvgaming/images/misc/navbit-home.png"></a>&nbsp;
        <a href="#">Stats</a>&nbsp;
        <img src="http://www.xvgaming.com/images/xvgaming/images/misc/navbit-arrow-right.png">&nbsp;
        <a href="http://www.xvgaming.com/games/stats/bfstats.php">Battlefield</a>
        
    </div>

    <div id="content">
        
        <?php
            $host
="localhost";
            
$user="wanderzo_savsin";
            
$password="savsin3";
            
$database="wanderzo_battlefield";
            
            
mysql_connect($host$user$password);
            
            @
mysql_select_db($database) or die("Unable To select database");
            
            
$query "SELECT * FROM XpTable WHERE (player_total_xp > 75) ORDER BY player_total_xp DESC";
            
            
$result mysql_query($query);
            
            
$num mysql_numrows($result);
            
            
mysql_close();
        
?>
        
        <div id="topbar">
    
            <div id="prevlink">
            
                <?php
                $incriment 
$_GET['nextpage'];
                
$startid $incriment 0;
                
$statsperpage 15;
                
                    if(
$startid 0)
                    {
                
?>
                        <a class="button" href="http://www.xvgaming.com/games/stats/bfstats.php?nextpage=<?php echo $incriment-$statsperpage?>"> &laquo; Back </a>
                <?php
                    
}
                    else
                    {
                
?>
                        <a class="button" href="#">&laquo; Back </a>  
                <?php
                    
}
                
?>
            
            </div>
        
            <div id="steamform">
            
                <form method="get" action="bfstatsbyname.php">
                <label>Enter Your SteamID:</label>
                <input type="text" maxlength="20" name="SteamID" value="STEAM_0:1:23456789" onFocus="if(value == 'STEAM_0:1:23456789') {value=''}" onBlur="if(value=='') {value='STEAM_0:1:23456789'}"/>
                <button type="submit">Submit</button>
                <div class="spacer"></div>
                </form>
                
            </div>
            
            <div id="nextlink">
                
                <?php                
                    
if($startid $statsperpage $num)
                    {
                    
?>
                    <a class="button" href="http://www.xvgaming.com/games/stats/bfstats.php?nextpage=<?php echo $incriment $statsperpage?>">Next &raquo;</a>
                    <?php
                    
}
                    else
                    {
                    
?>
                    <a class="button" href="#">Next &raquo; </a>  
                    <?php
                    
}
                
?>
            
            </div>
            
            <div class="spacer"></div>
        
        </div>
        
        <table class="stats">
            <tr>
                <th class="stats">Rank</th>
                <th class="stats">Name</th>
                <th class="stats">XP</th>
                <th class="stats">Assault</th>
                <th class="stats">Special Ops</th>
                <th class="stats">Sniper</th>
                <th class="stats">Engineer</th>
                <th class="stats">Medic</th>
                <th class="stats">Support</th>
            </tr>
        <?php
        $i 
$startid;
        
$RankNumber $startid 1;
        
            while(
$i $num)
            {
                
$player_id=mysql_result($result$i"player_id");
                
$player_name=mysql_result($result,$i,"player_name");
                
$player_total_xp=mysql_result($result,$i,"player_total_xp");
                
$player_class_assault_xp=mysql_result($result,$i,"player_class_assault_xp");
                
$player_class_specops_xp=mysql_result($result,$i,"player_class_specops_xp");
                
$player_class_sniper_xp=mysql_result($result,$i,"player_class_sniper_xp");
                
$player_class_engineer_xp=mysql_result($result,$i,"player_class_engineer_xp");
                
$player_class_medic_xp=mysql_result($result,$i,"player_class_medic_xp");
                
$player_class_support_xp=mysql_result($result,$i,"player_class_support_xp");
                
                if(
$i < ($startid $statsperpage))
                {
        
?>
                    <tr>
                        <td class="stats"><?php echo $RankNumber?></td>
                        <td class="stats"><a href="http://www.xvgaming.com/games/stats/bfstatsbyname.php?SteamID=<?php echo $player_id?>&Rank=<?php echo $RankNumber?>"><?php echo $player_name?></a></td>
                        <td class="stats"><?php echo $player_total_xp?></td>
                        <td class="stats"><?php echo $player_class_assault_xp?></td>
                        <td class="stats"><?php echo $player_class_specops_xp?></td>
                        <td class="stats"><?php echo $player_class_sniper_xp?></td>
                        <td class="stats"><?php echo $player_class_engineer_xp?></td>
                        <td class="stats"><?php echo $player_class_medic_xp?></td>
                        <td class="stats"><?php echo $player_class_support_xp?></td>
                    </tr>
            
        <?php
                    $i
++;
                    
$RankNumber++;
                }
                else
                {                    
                    break;
                }
            }
        
?>
        </table>
        
    </div>
    
    <div class="spacer"></div>
    
    <div id="footer">
        
        <div id="footerprevlink">
        
            <?php
            $incriment 
$_GET['nextpage'];
            
$startid $incriment 0;
            
$statsperpage 15;
            
                if(
$startid 0)
                {
            
?>
                    <a class="button" href="http://www.xvgaming.com/games/stats/bfstats.php?nextpage=<?php echo $incriment-$statsperpage?>"> &laquo; Back </a>
            <?php
                
}
                else
                {
            
?>
                    <a class="button" href="#">&laquo; Back </a>  
            <?php
                
}
            
?>
        
        </div>
        
        <div id="footernextlink">
            
            <?php
                $incriment 
$_GET['nextpage'];
                
$startid $incriment 0;
                
                if(
$startid $statsperpage $num)
                {
                
?>
                <a class="button" href="http://www.xvgaming.com/games/stats/bfstats.php?nextpage=<?php echo $incriment $statsperpage?>">Next &raquo;</a>
                <?php
                
}
                else
                {
                
?>
                <a class="button" href="#">Next &raquo; </a>  
                <?php
                
}
            
?>
        
        </div>
        
        <div class="spacer"></div>
        
    </div>

    <div class="spacer"></div>
    
</div>

</div>

</body>

</html>

Here is a link to what it looks like when i do the stuff for the template. I think the issue is that when it loops to create the table rows. There is only one set of variables which get changed each loop. So I think i need to create seperate variables for each row(while it loops and register them all in the loop)

Atleast thats what i think is wrong with it. Here is the link and the php/template files

http://www.xvgaming.com/bfstats.php

PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''bfstats');
define('CSRF_PROTECTION'true);  
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('BfStats',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits construct_navbits(array('' => 'Battlefield'));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle 'Battlefield Stats';

$host="localhost";
$user="wanderzo_savsin";
$password="savsin3";
$database="wanderzo_battlefield";

mysql_connect($host$user$password);

@
mysql_select_db($database) or die("Unable To select database");

$query "SELECT * FROM XpTable WHERE (player_total_xp > 75) ORDER BY player_total_xp DESC";

$result mysql_query($query);

$num mysql_numrows($result);

mysql_close();

$incriment $_GET['nextpage'];
$startid $incriment 0;
$statsperpage 15;

if(
$startid 0)
{
    
$prevstatspage $incriment-$statsperpage;
    
$prevlink '<a class="button" href="http://www.xvgaming.com/bfstats.php?nextpage=';
    
$prevlink2 '"> &laquo; Back </a>';
}
else
{
    
$prevlink '<a class="button" href="http://www.xvgaming.com/bfstats.php#">&laquo; Back </a>';
}
            
if(
$startid $statsperpage $num)
{
    
$nextstatspage = ($incriment $statsperpage);
    
$nextlink '<a class="button" href="http://www.xvgaming.com/bfstats.php?nextpage=';
    
$nextlink2 '">Next &raquo;</a>';
}
else
{
    
$nextlink '<a class="button" href="http://www.xvgaming.com/bfstats.php#">Next &raquo; </a>';
}

$i $startid;
$RankNumber $startid 1;

while(
$i $num)
{
    
$player_id=mysql_result($result$i"player_id");
    
$player_name=mysql_result($result,$i,"player_name");
    
$player_total_xp=mysql_result($result,$i,"player_total_xp");
    
$player_class_assault_xp=mysql_result($result,$i,"player_class_assault_xp");
    
$player_class_specops_xp=mysql_result($result,$i,"player_class_specops_xp");
    
$player_class_sniper_xp=mysql_result($result,$i,"player_class_sniper_xp");
    
$player_class_engineer_xp=mysql_result($result,$i,"player_class_engineer_xp");
    
$player_class_medic_xp=mysql_result($result,$i,"player_class_medic_xp");
    
$player_class_support_xp=mysql_result($result,$i,"player_class_support_xp");
    
    if(
$i < ($startid $statsperpage))
    {
        
$starttablerow '<tr>';
            
$starttablecell1 '<td class="stats">';
            
$endtablecell1 '</td>';
            
            
$starttablecell2 '<td class="stats"><a href="http://www.xvgaming.com/bfstatsbyname.php?SteamID=';
            
$tablecell2center '">';
            
$endtablecell2 '</a></td>';
            
            
$starttablecell3 '<td class="stats">';
            
$endtablecell3 '</td>';
            
            
$starttablecell4 '<td class="stats">';
            
$endtablecell4 '</td>';
            
            
$starttablecell5 '<td class="stats">';
            
$endtablecell5 '</td>';
            
            
$starttablecell6 '<td class="stats">';
            
$endtablecell6 '</td>';
            
            
$starttablecell7 '<td class="stats">';
            
$endtablecell7 '</td>';
            
            
$starttablecell8 '<td class="stats">';
            
$endtablecell8 '</td>';
            
            
$starttablecell9 '<td class="stats">';
            
$endtablecell9 '</td>';
            
        
$endtablerow '</tr>';
        
        
$i++;
        
$RankNumber++;
    }
    else
    {                    
        break;
    }
}


// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater vB_Template::create('BfStats');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);


$templater->register('prevstatspage'$prevstatspage);
$templater->register('prevlink'$prevlink);
$templater->register('prevlink2'$prevlink2);

$templater->register('nextstatspage'$nextstatspage);
$templater->register('nextlink'$nextlink);
$templater->register('nextlink2'$nextlink2);

//Rank Info
$templater->register('RankNumber'$RankNumber);
$templater->register('player_id'$player_id);
$templater->register('player_name'$player_name);
$templater->register('player_total_xp'$player_total_xp);
$templater->register('player_class_assault_xp'$player_class_assault_xp);
$templater->register('player_class_specops_xp'$player_class_specops_xp);
$templater->register('player_class_sniper_xp'$player_class_sniper_xp);
$templater->register('player_class_engineer_xp'$player_class_engineer_xp);
$templater->register('player_class_medic_xp'$player_class_medic_xp);
$templater->register('player_class_support_xp'$player_class_support_xp);

//Start Table
$templater->register('starttablerow'$starttablerow);

//Open Table Rows
$templater->register('starttablecell1'$starttablecell1);
$templater->register('starttablecell2'$starttablecell2);
$templater->register('starttablecell3'$starttablecell3);
$templater->register('starttablecell4'$starttablecell4);
$templater->register('starttablecell5'$starttablecell5);
$templater->register('starttablecell6'$starttablecell6);
$templater->register('starttablecell7'$starttablecell7);
$templater->register('starttablecell8'$starttablecell8);
$templater->register('starttablecell9'$starttablecell9);

//Cell Centers
$templater->register('tablecell2center'$tablecell2center);

//End the table rows
$templater->register('endtablecell1'$endtablecell1);
$templater->register('endtablecell2'$endtablecell2);
$templater->register('endtablecell3'$endtablecell3);
$templater->register('endtablecell4'$endtablecell4);
$templater->register('endtablecell5'$endtablecell5);
$templater->register('endtablecell6'$endtablecell6);
$templater->register('endtablecell7'$endtablecell7);
$templater->register('endtablecell8'$endtablecell8);
$templater->register('endtablecell9'$endtablecell9);

//End table
$templater->register('endtablerow'$endtablerow);

print_output($templater->render());
?>

Code:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if>  dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
       
        <LINK REL=StyleSheet HREF="games/stats/player_stats.css" TYPE="text/css">
               
        {vb:raw headinclude}
        <title>{vb:raw pagetitle}</title>

        <vb:if condition="$includecss">
                <vb:if condition="$vboptions['storecssasfile']">
                        <vb:each from="includecss" value="file">
                                {vb:cssfile {vb:raw file}}
                        </vb:each>
                <vb:else />
                        {vb:cssfile {vb:raw includecss}}
                </vb:if>
        </vb:if>
        {vb:raw headinclude_bottom}
</head>
<body>

        {vb:raw header}
       
        {vb:raw navbar}
       
        <div id="content">
               
                <div id="topbar">
       
                        <div id="prevlink">
                       
                                {vb:raw prevlink}{vb:raw prevstatspage}{vb:raw prevlink2}
                       
                        </div>
               
                        <div id="steamform">
                       
                                <form method="get" action="http://www.xvgaming.com/bfstatsbyname.php">
                                <label>Enter Your SteamID:</label>
                                <input type="text" maxlength="20" name="SteamID" value="STEAM_0:1:23456789" onFocus="if(value == 'STEAM_0:1:23456789') {value=''}" onBlur="if(value=='') {value='STEAM_0:1:23456789'}"/>
                                <button type="submit">Submit</button>
                                <div class="spacer"></div>
                                </form>
                               
                        </div>
                       
                        <div id="nextlink">
                               
                                {vb:raw nextlink}{vb:raw nextstatspage}{vb:raw nextlink2}
                       
                        </div>
                       
                        <div class="spacer"></div>
               
                </div>
               
                <table class="stats">
                        <tr>
                                <th class="stats">Rank</th>
                                <th class="stats">Name</th>
                                <th class="stats">XP</th>
                                <th class="stats">Assault</th>
                                <th class="stats">Special Ops</th>
                                <th class="stats">Sniper</th>
                                <th class="stats">Engineer</th>
                                <th class="stats">Medic</th>
                                <th class="stats">Support</th>
                        </tr>
                       
                        {vb:raw starttablerow}
                                {vb:raw starttablecell1}{vb:raw RankNumber}{vb:raw endtablecell1}
                                {vb:raw starttablecell2}{vb:raw player_id}{vb:raw tablecell2center}{vb:raw player_name}{vb:raw endtablecell2}
                                {vb:raw starttablecell3}{vb:raw player_total_xp}{vb:raw endtablecell3}
                                {vb:raw starttablecell4}{vb:raw player_class_assault_xp}{vb:raw endtablecell4}
                                {vb:raw starttablecell5}{vb:raw player_class_specops_xp}{vb:raw startendtablecell5}
                                {vb:raw starttablecell6}{vb:raw player_class_sniper_xp}{vb:raw endtablecell6}
                                {vb:raw starttablecell7}{vb:raw player_class_engineer_xp}{vb:raw endtablecell7}
                                {vb:raw starttablecell8}{vb:raw player_class_medic_xp}{vb:raw endtablecell8}
                                {vb:raw starttablecell9}{vb:raw $player_class_support_xp}{vb:raw endtablecell9}
                        {vb:raw endtablerow}
                </table>
                <div class="spacer">&nbsp;</div>
        </div>
        <div class="spacer"></div>
        {vb:raw footer}
       
</body>
</html>

So how would I be able to make the second bit of code using the templates to create the table rows like in the first standalone bfstats.php.

Thanks abunch in advanced.

Lynne 01-16-2012 09:51 PM

Why are you doing all these start and stop table rows? Why not just:

PHP Code:

while($i $num)
{
    
$player_id=mysql_result($result$i"player_id");
    
$player_name=mysql_result($result,$i,"player_name");
    
$player_total_xp=mysql_result($result,$i,"player_total_xp");
    
$player_class_assault_xp=mysql_result($result,$i,"player_class_assault_xp");
    
$player_class_specops_xp=mysql_result($result,$i,"player_class_specops_xp");
    
$player_class_sniper_xp=mysql_result($result,$i,"player_class_sniper_xp");
    
$player_class_engineer_xp=mysql_result($result,$i,"player_class_engineer_xp");
    
$player_class_medic_xp=mysql_result($result,$i,"player_class_medic_xp");
    
$player_class_support_xp=mysql_result($result,$i,"player_class_support_xp");
    
    
$output.='<tr><td class="stats">' .$RankNumber'</td>
        <td class="stats">' 
.$player_id'</td>
        <td class="stats">' 
.$player_total_xp'</td>
        etc
        </tr>'
;


Then make sure to register $output and then in the template in place of:
HTML Code:

                        {vb:raw starttablecell1}{vb:raw RankNumber}{vb:raw endtablecell1}
                                {vb:raw starttablecell2}{vb:raw player_id}{vb:raw tablecell2center}{vb:raw player_name}{vb:raw endtablecell2}
....
                                {vb:raw starttablecell9}{vb:raw $player_class_support_xp}{vb:raw endtablecell9}

HTML Code:

{vb:raw output}

SavSin 01-17-2012 12:35 AM

That worked perfectly. And to answer your question This was my first dabble in PHP and MySql. Im trying to teach it to my self and work on different things. So THANKS a ton.

I have a friend that wants to make a chrome widget that will alert him to new PM's and thread subscriptions on a VB forum so im learning some things about php and vb.

ClErK1991 01-22-2012 05:59 PM

thanks i like this

Rocket2009 01-24-2012 02:15 AM

I am still hoping for help. I have implemented dozens and dozens of pages using this process with lots of customization. Thanks Lyne. I have embedded newsfeeds, slideshows, spreadsheets, and etc. So I am fairly familiar with the method.

I am having trouble with one implementation. It looks beautiful, but it doesn't recognize me as logged in user.

I call the test.php (using the demo model terminology from the original post in this article) from another page, let's call that index.php (really a complex application). If I require_once global.php on test.php, it doesn't work (printing variables shows me as a guest). I can require_once global.php on index.php and it works and shows me as logged in. I can pass the security token obtained from index.php to either test.php via an assign function in that application has very similar to the templater register used by VB for test.php. I have seen the security value on the test.php (printing variables) and have rendered the security value into the template html output.

The result is that whenever I render an html page from this system (index.php calls test.php which uses template TEST to create an html page) it shows me as not logged in and the page source shows me as a guest. If I navigate to another forum page, I am still logged in.

So here are some questions and hopefully I can get some help for further study:

(1) If I can get a security token in the world of index.php such as

PHP Code:

<?php
$curdir 
getcwd ();
chdir('/home/touring7/public_html/forum/');
require_once(
'./global.php');
chdir ($curdir);

//Can pass these values to the html page or the external php page
$tokenkb $vbulletin->userinfo['securitytoken'];
//$uidkb = $vbulletin->userinfo['userid'];

I have tried assigned it to the html template (TEST) as:

HTML Code:

<input type="hidden" name="securitytoken" value="{tokenkb}" />
Note it has a slightly different format from an assign from test as it doesn't have vb:raw. But even though I see the value in the page source, it doesn't unlock the page and still shows me as a guest.

One of two options, in my mind. I am either doing something wrong with passing the security token in terms of the input statement. Do I need to pass more than the security token? -or- index.php is disabling or clearing the session so the security token doesn't log me into the system. Interestingly, remember that if I navigate to another forum page I am still logged in and everything is fine.

Does anyone have a suggestion on how to pass the security token. Does the syntax look OK. I have never unlocked a page in this manner.

Or is there a command or series of command I can search through in the world of index.php that would disable (temporarily) the session so it can't recognize a user as logged in. I might be able to disable or adjust this function.

Any advice or suggestions would be much appreciated.

Lynne 01-24-2012 04:33 PM

Why are you focusing on passing the securitytoken? What about the userid - that is the variable you need.

Rocket2009 01-25-2012 01:00 AM

Quote:

Originally Posted by Lynne (Post 2291817)
Why are you focusing on passing the securitytoken? What about the userid - that is the variable you need.

Yes, I am sure I could pass userid to that page. My problem is that the Header and NavBar templates test to see if I am a member and since apparently I am not (security token is at guest), at this point, the header template prints out an empty login box and the navbar template puts a notice note on the page that says something like: "If this your first time on this site you may register ...".

My hack around this is to modify header to skip that assessment for this page (THIS_SCRIPT test) and not show anything in the upper right corner and to modify Navbar in the same manner to skip the messages for this page. So it's not elegant but it sort of works. The problem is that there are times that I get logged out after viewing this page (weird inconsistent behavior of tokens I think and browser caches).

My thought is that if I could log myself back in after going through this other application, which apparently tries to flush the session or some sort of thing, I would be golden and this page would work like the dozens of others and I wouldn't have to worry about being logged out.

So I thought if I used the security token I could log myself back in. This would be the cleanest approach forward. Any suggestions on how to do this, assuming you agree on the approach. I have seen some threads on remote login. Should I implement this on the test.php? Suggested thread for VB4 to help me do this? My security token notes were related to a post that Lynne made on this thread to use <input ...>.

If I can't get this to work, my latest brainstorm is to experiment with merging index.php (the launch code for the other application) and test.php (the code for rendering VB pages via the tutorial Lynne pulled together). I don't like this approach since it will be difficult to maintain through updates of the other application, even assuming I can get it to work. The other application renders global variables into templates as well. I think it was already a miracle that I could get the other application to call test.php and have them both render things into the TEST template.

Suggestions on approaches to stay logged in would be appreciated!

--------------- Added [DATE]1327535262[/DATE] at [TIME]1327535262[/TIME] ---------------

Additionally, does anyone have any idea of what types of php commands in the other application might be logging me off the vbulletin system? I might be able to search for those and circumvent them.

Thanks.

nerbert 01-27-2012 09:02 PM

I've recently built a new page and want to put in ad locations. There's something about the variable "$ad_location" that won't let me do it. "$bad_location" works though. Is there some special handling you have to do to use that variable name?

kh99 01-28-2012 12:45 AM

Quote:

Originally Posted by nerbert (Post 2293218)
I've recently built a new page and want to put in ad locations. There's something about the variable "$ad_location" that won't let me do it. "$bad_location" works though. Is there some special handling you have to do to use that variable name?

What do you mean by "won't let you do it"? Where are you trying to use that variable?

nerbert 01-28-2012 01:14 AM

Well, the problem I'm having is that I don't use ads on my own forum but I'm working on a new page for someone else who does. So I don't know much about how to place ads, and it's hard to design a page that uses them and get a new set of locations in the adminCP. Anyway I'm fumbling my way through this by trial and error.

"$ad_location" seems to be reserved by vBulletin so you can't just use it any way you want. But as I said, I'm figuring this out.

I wish you could search for "ad location" but "ad" is too short!!!!!!

If I ever get this working maybe I should write an article.


All times are GMT. The time now is 05:27 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.02593 seconds
  • Memory Usage 1,990KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_html_printable
  • (4)bbcode_php_printable
  • (2)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