Autor Tópico: Ad Management - Gerenciamento do anúncio manual  (Lida 13240 vezes)

0 Membros e 3 Visitantes estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5073
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Ad Management - Gerenciamento do anúncio manual
« em: 28 de Abril de 2011, 23:30 »
Nome:Ad Management mod
Ficheiro: ad_mod_v3.0.1_SMF_v1-1-x.zip Mod em En
Ficheiro:   ad_mod_v3.0_SMF_v2-0.zip Mod em En

Autor do Mod:vbgamer45
Type:New Feature
Versao do Mod: 3.0.1
Autor da Tradução: Candidosa2
Tradução em: Pt_PT-UTF8
Tradução em: Pt_BR-UTF8
Versões Antigas: disponível 1.1.9, 1.1.10, 1.1.11 e Beta 4, 2.0 RC1.2, 2.0 RC2, 2.0 RC3
Download em En -
Versao: disponível 1.1.12, 1.1.13, 2.0 RC3, 2.0 RC4, 2.0 RC5

Testado com tema default Funciona 100%


./index.php

Pesquisar
Código: [Seleccione]
'trackip' => Array ( 'Profile.php', 'trackIP'),
Adicionar
Código: [Seleccione]
'admod' => array('Ads.php', 'Ads'),
Pesquisar
Código: [Seleccione]
require_once($sourcedir . '/Security.php');
Adicionar
Código: [Seleccione]
if (file_exists($sourcedir . '/LoadAds.php'))
require_once($sourcedir . '/LoadAds.php');

Pesquisar
Código: [Seleccione]
loadPermissions();
Adicionar
Código: [Seleccione]
// Load all the ads up
if (function_exists("loadAds"))
loadAds();



./Sources/Subs.php

Pesquisar
Código: [Seleccione]
loadLanguage('Admin');
Adicionar
Código: [Seleccione]
loadLanguage('Ads');
Pesquisar
Código: [Seleccione]
'manage_themes' => '<a href="' . $scripturl . '?action=theme;sa=admin;sesc=' . $sc . '">' . $txt['theme_admin'] . '</a>',
Adicionar
Código: [Seleccione]
'edit_addmod' => '<a href="' . $scripturl . '?action=admod">' . $txt['ad_management'] . '</a>',


./Themes/default/index.template.php

Pesquisar
Código: [Seleccione]
<body>'; ou
Código: [Seleccione]
<body> mais tem que ser depois de
Código: [Seleccione]
';

Adicionar
Código: [Seleccione]
//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);
}



Pesquisar
Código: [Seleccione]
</td> Que fica no fim disto

// Otherwise they're a guest - this time ask them to either register or login - lazy bums...

Adicionar
Código: [Seleccione]
';
//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads = show_welcomeAds();
if(!empty($ads))
{
echo '<td class="windowbg2">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</td>';
}
unset($ads);
}
echo '


Pesquisar
Código: [Seleccione]
template_menu();
Adicionar..
Código: [Seleccione]
//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);
}


ou Adicionar
Código: [Seleccione]
//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

Pesquisar
Código: [Seleccione]
// Show some statistics next to the link tree if SP1 info is off.
Adicionar
Código: [Seleccione]
//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);
}

Pesquisar
Código: [Seleccione]
echo '
</div>';

Adicionar
Código: [Seleccione]
//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

Pesquisar
Código: [Seleccione]
global $context, $settings, $options, $txt, $scripturl, $modSettings;
Adicionar
Código: [Seleccione]
//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);
}

Pesquisar
Código: [Seleccione]
// Get all the messages...
while ($message = $context['get_message']())
{

Trocar por este
Código: [Seleccione]
//Ad Counter
$adcounter =0;
// Get all the messages...
while ($message = $context['get_message']())
{
$adcounter++;

Pesquisar
Código: [Seleccione]
</td></tr>';
}

Trocar por
Código: [Seleccione]
</td></tr>';
if (function_exists("show_posts"))
{
if ($adpost = show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '

<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="windowbg3">
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $context['forum_name'], '</b>
<div class="smalltext">
</div>
</td>
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle"><img src="', $message['icon_url'] . '" alt="" border="0" /></td>
<td valign="middle">
<div style="font-weight: bold;" id="subject_', $message['id'], '">
<a href="', $message['href'], '">', $message['subject'], '</a>
</div>
<div class="smalltext">« <b>', !empty($message['counter']) ? $txt[146] . ' #' . $message['counter'] : '', ' ', $txt[30], ':</b> ', $message['time'], ' »</div></td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
', $reply_button, '';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
', $reply_button, '';

// Can the user modify the contents of this post?
if ($message['can_modify'])
echo '
', $modify_button, '';

// How about... even... remove it entirely?!
if ($message['can_remove'])
echo '
', $remove_button, '';

// What about splitting it off the rest of the topic?
if ($context['can_split'])
echo '
', $split_button, '';
echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</div>
</td>
</tr>
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
</td>
</tr></table>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
}
else
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="windowbg3">', $adpost['type'] == 0 ? $adpost['content'] : eval($adpost['content']) , '</td>
</tr>
</table>
</td></tr>';
}

}

}

if(function_exists("show_lastpostAds") && function_exists("show_posts"))
{
if(($ads = show_lastpostAds()) && !show_posts($adcounter))
{
if($modSettings['ads_lookLikePosts'])
{
echo '

<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr><td class="windowbg3">
<table width="100%" cellpadding="5" cellspacing="0" style="table-layout: fixed;">
<tr>
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
<b>', $context['forum_name'], '</b>
<div class="smalltext">
</div>
</td>
<td valign="top" width="85%" height="100%">
<table width="100%" border="0"><tr>
<td valign="middle">&nbsp;</td>
<td valign="middle">
&nbsp;</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" height="20" style="font-size: smaller;">';
if ($context['can_reply'] && !empty($options['display_quick_reply']))
echo '
', $reply_button, '';

// So... quick reply is off, but they *can* reply?
elseif ($context['can_reply'])
echo '
', $reply_button, '';


echo '
</td>
</tr></table>
<hr width="100%" size="1" class="hrcolor" />
<div class="post">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</div>
</td>
</tr>
<tr>
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" valign="bottom" class="smalltext">
<img src="', $settings['images_url'], '/ip.gif" alt="" border="0" />&nbsp;', $txt[511], '
</td>
</tr></table>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
}
else
echo '
<tr><td style="padding: 1px 1px 0 1px;">
<table width="100%" cellpadding="3" cellspacing="0" border="0">
<tr>
<td class="windowbg3">', $ads['type'] == 0 ? $ads['content'] : eval($ads['content']) , '</td>
</tr>
</table>
</td></tr>';

}

}



./Themes/default/MessageIndex.template.php
Pesquisar
Código: [Seleccione]
global $context, $settings, $options, $scripturl, $modSettings, $txt;

Adicionar
Código: [Seleccione]
//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);
}

Pesquisar
Código: [Seleccione]
echo '
</table>
</div>';

Adicionar
Código: [Seleccione]
//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
Pesquisar
Código: [Seleccione]
'pm' => array(

Trocar por
Código: [Seleccione]
'ad_manage' => array(
'ad_manageperm' => false,
),
'pm' => array(

install.php Coloque aonde tem a pasta do forum smf

Citar
CREATE TABLE IF NOT EXISTS {$db_prefix}ads (
ADS_ID mediumint( unsigned NOT NULL auto_increment,
NAME tinytext NOT NULL,
CONTENT text NOT NULL,
BOARDS tinytext,
POSTS tinytext,
CATEGORY tinytext,
HITS mediumint( 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',
PRIMARY KEY (ADS_ID)
)


Citar
CREATE TABLE IF NOT EXISTS {$db_prefix}ads_settings (
variable tinytext NOT NULL,
value text NOT NULL,
PRIMARY KEY (variable(30))
)

Citar
ALTER IGNORE TABLE {$db_prefix}ads
ADD show_lastpost smallint(4) NOT NULL default '0' AFTER show_threadindex

Código: [Seleccione]
ALTER IGNORE TABLE {$db_prefix}ads
ADD CATEGORY tinytext AFTER POSTS

Código: [Seleccione]
ALTER IGNORE TABLE {$db_prefix}ads
ADD show_underchildren smallint(4) NOT NULL default '0'

Citar
INSERT IGNORE INTO {$db_prefix}settings
(variable, value)
VALUES ('ads_displayAdsAdmin', '0'),
('ads_updateReports', '0'),
('ads_quickDisable', '0'),
('ads_lookLikePosts', '1')



Nao esqueca destes ficheiros que tem colocar no servidor

Ads.php" Pasta do teu forum "./Sources"
LoadAds.php" Pasta do teu fórum "./Sources"
Ads.template.php" Pasta do teu template"./Themes/default
Ads.teuidioma.php" Pasta de idioma do forum "./Themes/default/languages

Se tiver alguma duvida e so postas aqui