Arkadaşlar bu güzel modun sadece forumda değil forum dışındaki sayfalarda da çalışmasını istiyorsak, bunu aşağıdaki adımları uygulayarak yapabiliriz.
1. Modun çalışmasını istediğimiz sayfanın kodlarında en üste aşağıdaki kodu yapıştırıp kendi sitemize göre düzenliyoruz.
<?php include("/home/xxxx/public_html/xxxx_forum/SSI.php"); ?>
2. popup.php adlı bir dosya açıp içine aşağıdaki kodları yapıştırın. Sonra da bunu xxxx_forum/Sources klasörüne atın. (Ekte de dosyayı paylaşacağım.)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<?php
global $context, $settings, $boardurl, $modSettings, $cookiename;
// Load language file if we are loading the Help stuff:
if (isset($_GET['action']) && $_GET['action'] == 'help')
{
loadLanguage('RealPopup');
return;
}
// Don't include anything if the mod is disabled!!!
if (empty($modSettings['realpopup_enabled']))
return;
// Don't include anything if membergroups are enabled and not in one of the membergroups:
if (!empty($modSettings['realpopup_hide_from_membergroups']) && allowedTo('realpopup_hide_popup'))
return;
$fxeffect = (empty($modSettings['realpopup_fxeffect']) ? 'swing' : $modSettings['realpopup_fxeffect']);
$display = (empty($modSettings['realpopup_display']) ? 'immediate' : $modSettings['realpopup_display']);
$value = empty($modSettings['realpopup_display_value']) ? '0' : $modSettings['realpopup_display_value'];
$display = ($display == 'percentage' ? $value . '%' : ($display == 'seconds' ? $value. 's' : 'immediate'));
$duration = (empty($modSettings['realpopup_duration']) ? 'session' : $modSettings['realpopup_duration']);
$value = empty($modSettings['realpopup_duration_value']) ? '0' : $modSettings['realpopup_duration_value'];
$duration = ($duration == 'min' ? $value . 'min' : ($duration == 'hrs' ? $value. 'hrs' : ($duration == 'hrs' ? $value. 'days' : ($duration == 'session' || $duration == 'always' ? $duration : 'session'))));
$popup = '
<script><!-- // --><![CDATA[
window.jQuery || document.write(\'<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"><\/script>\');
// ]]></script>
<link rel="stylesheet" type="text/css" href="' . $boardurl . '/RealPopup/blossomfeaturebox.css" />
<link rel="stylesheet" type="text/css" href="' . $boardurl . '/RealPopup/optincontent.css" />
<script type="text/javascript" src="'. $boardurl . '/RealPopup/blossomfeaturebox.js"></script>' . (!empty($modSettings['realpopup_adblock']) ? '
<script type="text/javascript" src="'. $boardurl . '/RealPopup/blockadblock.js"></script>' : '') . '
<script type="text/javascript"><!-- // --><![CDATA[
function UsePopup()
{
jQuery(function($){
blossomfeaturebox.init({
optinfile: "' . $boardurl . '/RealPopup/optincontent.txt",
fxeffect: "' . $fxeffect . '",
displaytype: "' . $display . '",
displayfreq: {
duration: "' . $duration . '",
cookiename: "' . $cookiename . '_featurebox"
}' . (!empty($modSettings['realpopup_adblock']) && !empty($modSettings['realpopup_no_escape']) ? ',
escape: false' : '') . '
})
});
}' . (empty($modSettings['realpopup_adblock']) ? '
UsePopup();' : '
if(typeof blockAdBlock === "undefined") {
UsePopup();
} else {
blockAdBlock.on(true, UsePopup);
}') . '
// ]]></script>';
echo $popup;
// Build any styling differences:
$style = array();
if (!empty($modSettings['realpopup_max_width']))
$style[] = 'max-width: ' . str_replace('pxpx', 'px', $modSettings['realpopup_max_width'] . 'px') . ';';
if (!empty($modSettings['realpopup_color']))
$style[] = 'color: #' . substr('000000' . $modSettings['realpopup_color'], 0, 6) . ';';
if (!empty($modSettings['realpopup_background']))
$style[] = 'background: #' . substr('000000' . $modSettings['realpopup_background'], -6) . ';';
// Include any inline styling changes to the forum:
if (!empty($style) || !empty($modSettings['realpopup_black_screen']))
$bs = '
<style>';
echo $bs;
if (!empty($style))
$fb = '
div.blossomfeaturebox div.optincontent2wrapper{
' . implode('
', $style) . '
}';
echo $fb;
// Change the opacity to create a black screen overlay:
if (!empty($modSettings['realpopup_black_screen']))
$eb = '
div.blossomfeaturebox:before{
opacity: 1.0;
}';
echo $eb;
if (!empty($style) || !empty($modSettings['realpopup_black_screen']))
$is = '
</style>';
echo $is;
?>
3. Modun çalışmasını istediğimiz sayfanın head etiketleri arasında bir yere alttaki kodu yapıştırın. Gerekli yerleri sitenize göre düzeltin.
<?php include("xxxx_forum/Sources/popup.php"); ?>
Not: Anlatımı sayfanın ana dizinde, forumun ise ana dizindeki xxxx_forum klasörü içinde olduğunu düşünerek hazırladım.