How to add your own custom adcode blocks in 3 minutes
Download the zip file and open the named php files using a plain text editor (something like MSWord which uses formatting will break the code). Follow the simple instructions below then save, upload and overwrite your existing files. Your new custom adcode block will be at the bottom of the header/footer section of your vB Ad Management settings.
You can add as many custom blocks as you like as long as you give each one a different name. They'll work on any page, obey all permissions and work with all features including Ad-Sharing.
To name a custom adcode block, just find/replace every instance of the word "custom" in the code below with the new name of your choice.
داخل فایل vb_ad_management_3xx.xml
پیدا کنید :
کد:
<template name="footer_advertisement" templatetype="template"><![CDATA[
<div align="center">
$footer_adcode
</div>
]]></template>
زیرش ادد کنید :
کد:
<template name="custom_advertisement" templatetype="template"><![CDATA[
<div>
$custom_adcode
</div>
]]></template>
پیدا کنید :
کد:
<setting varname="adintegrate_footer_adcode_rand" displayorder="45">
<datatype>free</datatype>
<optioncode>textarea</optioncode>
</setting>
زیرش ادد کنید :
کد:
<setting varname="adintegrate_custom_onoff" displayorder="991">
<datatype>boolean</datatype>
<optioncode>yesno</optioncode>
<defaultvalue>0</defaultvalue>
</setting>
<setting varname="adintegrate_custom_adcode" displayorder="992">
<datatype>free</datatype>
<optioncode>textarea</optioncode>
</setting>
<setting varname="adintegrate_custom_adcode_rand" displayorder="993">
<datatype>free</datatype>
<optioncode>textarea</optioncode>
</setting>
داخل فایل /vb_ad_management/cache_templates.php
پیدا کنید :
کد:
if ($vbulletin->options['adintegrate_footer_onoff'])
{
$adtemplates[] = 'footer_advertisement';
}
زیرش ادد کنید :
کد:
if ($vbulletin->options['adintegrate_custom_onoff'])
{
$adtemplates[] = 'custom_advertisement';
}
داخل فایل : /vb_ad_management/global_start.php
پیداکنید :
کد:
if ($vbulletin->options['adintegrate_footer_onoff'])
زیرش ادد کنید:
کد:
if ($vbulletin->options['adintegrate_custom_onoff'])
{
if ($vbulletin->options['adintegrate_custom_adcode'])
{
$custom_split = explode("$adshared", $vbulletin->options['adintegrate_custom_adcode']);
$custom_adcode = $custom_split[0];
if ($custom_split[1])
{
$custom_adcode = $custom_split[0] . $GLOBALS['adcode_shared'] . $custom_split[1];
}
eval('$custom_advertisement = "' . fetch_template('' . custom_advertisement . '') . '";');
}
else if ($vbulletin->options['adintegrate_custom_adcode_rand'])
{
$custom_adcode = explode("$addelimiter", $vbulletin->options['adintegrate_custom_adcode_rand']);
$custom_rand = array_rand($custom_adcode);
$custom_adcode = $custom_adcode["$custom_rand"];
$custom_split = explode("$adshared", $custom_adcode);
$custom_adcode = $custom_split[0];
if ($custom_split[1])
{
$custom_adcode = $custom_split[0] . $GLOBALS['adcode_shared'] . $custom_split[1];
}
eval('$custom_advertisement = "' . fetch_template('' . custom_advertisement . '') . '";');
}
}
مشکلی با این برنامه اگه داشتید بگید براتون توی vb.org تاپیک بزنم