Ad Management 2.0 RC1.2 için Manuel Kurulum
./index.php
Bul: 'admin' => array('Admin.php', 'AdminMain'),
Sonrasına Ekle: 'ads' => array('Ads.php', 'Ads'),
Bul:require_once($sourcedir . '/Security.php');
Sonrasına Ekle:if (file_exists($sourcedir . '/LoadAds.php'))
require_once($sourcedir . '/LoadAds.php');
Bul: loadPermissions();
Sonrasına Ekle:
// Load all the ads up
if (function_exists("loadAds"))
loadAds();
./Sources/Admin.php
Bul: loadLanguage('Admin');
Sonrasına Ekle:
loadLanguage('Ads');
Bul: 'theme' => array(
'label' => $txt['theme_admin'],
'file' => 'Themes.php',
'function' => 'ThemesMain',
'custom_url' => $scripturl . '?action=admin;area=theme;sa=admin',
'icon' => 'themes.gif',
'subsections' => array(
'admin' => array($txt['themeadmin_admin_title']),
'list' => array($txt['themeadmin_list_title']),
'reset' => array($txt['themeadmin_reset_title']),
'edit' => array($txt['themeadmin_edit_title']),
),
),
Sonrasına Ekle:'ads' => array(
'label' => $txt['ad_management'],
'file' => 'Ads.php',
'function' => 'Ads',
'custom_url' => $scripturl . '?action=admin;area=ads;sa=main',
'icon' => 'themes.gif',
'subsections' => array(
'main' => array($txt['ad_management_main']),
'add' => array($txt['ad_management_add']),
'reports' => array($txt['ad_management_reports']),
'settings' => array($txt['ad_management_settings']),
'credits' => array($txt['ad_management_credits']),
),
),
./Themes/default/index.template.php
Bul:<body>';
Sonrasına Ekle:
//Display ads on the top of the page
if (function_exists("show_topofpageAds"))
{
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
Bul: <div class="windowbg2 clearfix">';
Değiştir: <div class="windowbg2 clearfix floatleft">';
Bul: <form class="windowbg" id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, '' . $context['session_id'] . '');"' : '', '>
Değiştir: <form class="windowbg2" id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, '' . $context['session_id'] . '');"' : '', '>
Bul: echo '
</div>
Sonrasına Ekle:';
echo '<div class="windowbg2 clearfix" align="right">';
//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads = show_welcomeAds();
if(!empty($ads))
{
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
}
unset($ads);
}
echo '</div>';
echo '
Bul: template_menu();
Sonrasına Ekle: //Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads = show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
//Tower left Ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';
unset($ads);
//Tower Right Ads
$ads = show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}
Bul: // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
Öncesine Ekle:
//Close table for towerright ads
if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
{
$ads = show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td></tr></table>';
unset($ads);
//Close table for towerleft ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);
//Show ads on the bottom of the page
$ads = show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
./Themes/default/BoardIndex.template.php
Bul: // Show some statistics if stat info is off.
Öncesine Ekle://Display ads on the board index
if (function_exists("show_boardAds"))
{
$ads = show_boardAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
Bul: echo '
</div>';
Sonrasına Ekle://Display ads Between cats
if (function_exists("show_category"))
{
$ads = show_category($category['id']);
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
./Themes/default/Display.template.php
Bul:global $context, $settings, $options, $txt, $scripturl, $modSettings;
Sonrasına Ekle://Display ads on the thread page
if (function_exists("show_threadAds"))
{
$ads = show_threadAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
Bul: // Get all the messages...
while ($message = $context['get_message']())
{
Değiştir: //Ad Counter
$adcounter =0;
// Get all the messages...
while ($message = $context['get_message']())
{
$adcounter++;
Bul: </div>';
}
Değiştir: </div>';
if (function_exists("show_posts"))
{
if ($adpost = show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">';
// Show information about the poster of this message.
echo '
<div class="floatleft poster">
<h4>', $context['forum_name'], '</h4>';
// Done with the information about the poster... on to the post itself.
echo '
</div>
<div class="postarea">
<div class="keyinfo">
<h5 id="subject_', $message['id'], '">
<a href="', $message['href'], '" rel="nofollow">', $message['subject'], '</a>
</h5>
<div class="smalltext">« <strong>', !empty($message['counter']) ? $txt['reply'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' »</div>
<div id="msg_', $message['id'], '_quick_mod"></div>
</div>';
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<ul class="smalltext postingbuttons">';
// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li>', $reply_button, '</li>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li>', $reply_button, '</li>';
// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
<li>', $modify_button, '</li>';
// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
<li>', $remove_button, '</li>';
// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
<li>', $split_button, '</li>';
// Can we restore topics?
if ($context['can_restore_msg'])
echo '
<li>', $restore_message_button, '</li>';
// Show the post itself, finally!
echo '
</ul>
<div class="post" id="msg_', $message['id'], '"', '>
', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'
</div>
</div>
</div>
</div>';
}
else
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'</div>
</div>';
}
}
}
if(function_exists("show_lastpostAds") && function_exists("show_posts"))
{
if(($adpost = show_lastpostAds()) && !show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">';
// Show information about the poster of this message.
echo '
<div class="floatleft poster">
<h4>', $context['forum_name'], '</h4>';
// Done with the information about the poster... on to the post itself.
echo '
</div>
<div class="postarea">
<div class="keyinfo">
<div id="msg_', $message['id'], '_quick_mod"> </div>
</div>';
// If this is the first post, (#0) just say when it was posted - otherwise give the reply #.
echo '
<ul class="smalltext postingbuttons">';
// Can they reply? Have they turned on quick reply?
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
<li>', $reply_button, '</li>';
// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
<li>', $reply_button, '</li>';
// Show the post itself, finally!
echo '
</ul>
<div class="post" id="msg_', $message['id'], '"', '>
', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'
</div>
</div>
</div>';
}
else
echo '
<div class="bordercolor">
<div class="clearfix windowbg3 largepadding">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) ,'</div>
</div>';
}
}
echo '</div>';
./Themes/default/MessageIndex.template.php
Bul:global $context, $settings, $options, $scripturl, $modSettings, $txt;
Sonrasına Ekle://Display Ads on the Message index
if (function_exists("show_threadindexAds"))
{
$ads = show_threadindexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
Bul: echo '
</table>
</div>';
Sonrasına Ekle: //Display Ads on the Message index
if (function_exists("show_underchildren"))
{
$ads = show_underchildren();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}
./Sources/ManagePermissions.php
Bul: 'profile_remote_avatar' => array(false, 'profile', 'use_avatar'),
Sonrasına Ekle: 'ad_manageperm' => array(false, 'ad_manage', 'administrate'),
install.php
Bu dosyayı sunucunuza yükleyerek çalıştıramazsanız. Aşağıdaki sorguları elle sorgulatmanız gerekebilir.
Sorgu: CREATE TABLE IF NOT EXISTS {db_prefix}ads (
ADS_ID mediumint(8) unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
CATEGORY tinytext,
HITS mediumint(8) NOT NULL default '0',
TYPE smallint(4) NOT NULL default '0',
show_index smallint(4) NOT NULL default '0',
show_board smallint(4) NOT NULL default '0',
show_threadindex smallint(4) NOT NULL default '0',
show_lastpost smallint(4) NOT NULL default '0',
show_thread smallint(4) NOT NULL default '0',
show_bottom smallint(4) NOT NULL default '0',
show_welcome smallint(4) NOT NULL default '0',
show_topofpage smallint(4) NOT NULL default '0',
show_towerright smallint(4) NOT NULL default '0',
show_towerleft smallint(4) NOT NULL default '0',
show_betweencategories smallint(4) NOT NULL default '0',
show_underchildren smallint(4) NOT NULL default '0
Sorgu: INSERT IGNORE INTO {db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts
Ekte bulunan "Ads.php" dosyasını "./Sources" dizinine kopyalayın.
Ekte bulunan "LoadAds.php" dosyasını "./Sources" dizinine kopyalayın.
Ekte bulunan "Ads.template.php" dosyasını "./Themes/default" dizinine kopyalayın.
Ekte bulunan "Ads.turkish.php" dosyasını "./Themes/default/languages" dizinine kopyalayın.
Ekte bulunan "install.php" dosyasını "forum dizinine" atıp çalıştırın