News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SimpleAds

Started by [SiNaN], May 14, 2010, 02:49:55 AM

Previous topic - Next topic

blue_shadow

Doesn't seem to display adsense for me. Anyone have thoughts?

maf_avt

Quote from: [SiNaN] on May 25, 2010, 06:43:31 AM
Fatal error: Call to undefined function template_ad_position() in /home/uniquez-home/public_html/v2/Sources/Load.php(2458) : eval()'d code on line 394

I have made a custom position so that it shows just above the menu and below the info center.
Please could you help me with this error.

See if this fixes it:

Sources/Errors.php

Code (Find) Select
// Don't bother indexing errors mate...

Code (Replace) Select
global $sourcedir;
require_once($sourcedir . '/Subs-Ads.php');
load_ads();

// Don't bother indexing errors mate...

[/quote]

Hello! Have same error make replace as you advise but - error still here. Please, can you help me?
Call to undefined function template_ad_position() in /home/***/data/www/***.org/forum/Sources/Load.php(2396) : eval()'d code on line 337

stencorp69

Quote from: [SiNaN] on February 15, 2011, 10:58:47 PM
Use PHP "or". Like: {action} == 'x' || {action} == 'y'

Is "all" == "all" a wild card for all actions or all boards? Not being particularly skillful at php I found it easier to ad "forum," directly to the default _display field in the DB, which seems to work but is harder to manage.

stencorp69

This program is working really well and I have a question regarding ad positioning. I have edited the index.php files to position the add beside the forum banner in the DS-Natural theme with the following code;

   <div id="mainarea">
      <div id="header" class="wrapper">
         <div id="logo">
            <a href="'.$scripturl.'" title=""></a>
         </div>
        <div id="adbanner">';
           template_ad_position('PPBanner');
           echo '
         </div>

      </div>';

I was wondering what code I would need to insert to have the  template_ad_position('PPBanner') float on the right hand side of the <div id="logo">?

I have seen this CSS code that would work for two static images, could you call the  template_ad_position('PPBanner') from the CSS file?

Quote from: Antechinus on November 19, 2012, 02:18:33 PM
..
body {
background: url(../images/custom/charset01.png) 0 100% 0 fixed no-repeat,  url(../images/custom/charset02.png) 100% 100% 0 fixed no-repeat, url(../images/custom/mainbg.jpg) fixed;
background-color: #a7a7a7;
font: 13px/150% "Arial", "san-serif", sans-serif;
padding: 30px 0 0 0;
margin: 0;
}



winsoft

going to install it, hope it still works :)

Realinfo

See if this fixes it:

Sources/Errors.php

Code (Find) Select
// Don't bother indexing errors mate...

Code (Replace) Select
global $sourcedir;
require_once($sourcedir . '/Subs-Ads.php');
load_ads();

// Don't bother indexing errors mate...

[/quote]


I try that But still getting...............

function template_ad_position() in /Sources/Load.php(2322) : eval()'d code on line 291
[29-Dec-2012 18:06:19] PHP Fatal error:  Call to undefined function template_ad_position() in /Sources/Load.php(2322) : eval()'d code on line 291

novill

I use long time this mod. Worked fine so far, but now for some reason the ads aren't displayed above info center.
Installed the 1.0.1 version, without error. Before that i used 1.0 version.

All others place ads are fine.

How can i find why is that so.
Thanks for advise.

winsoft

it's a good mod but abandoned or neglected.

Uninstalling is a mission.

Gaz-uk

I cant get this mod to show up images how do you do this ..?

What other mods are easy to do if this one is no longer supported ?

live627

Use HTML code? BBcode?

eQuuS

#470
Hi,


I install the above. modification is all about by. So I press install the installer. Redirects me to the main forum page and my eyes appears above. the message "Unable to load template 'Ads'." Uninstalled manually using the instructions to modify the parser. I can not go to the PA, summarizing the forum contains only one sub. The index.php file and removed the code related to that contained "Ads" but it created a new bug, so reinstated. Any ideas? Hosting supports PHP 3.4 and 5 Translated by Google. SMF 2.0.4 SharkMake Problem solved, I reinstalled forum. Translated by Google.


Regards,
eQuuS

dzi

Quote from: eQuuS on March 27, 2013, 04:12:52 PM
Hi,


I install the above. modification is all about by. So I press install the installer. Redirects me to the main forum page and my eyes appears above. the message "Unable to load template 'Ads'." Uninstalled manually using the instructions to modify the parser. I can not go to the PA, summarizing the forum contains only one sub. The index.php file and removed the code related to that contained "Ads" but it created a new bug, so reinstated. Any ideas? Hosting supports PHP 3.4 and 5 Translated by Google. SMF 2.0.4 SharkMake Problem solved, I reinstalled forum. Translated by Google.


Regards,
eQuuS
And I getting this error.. Can anybody know how to fix it?

72 454

Session ID

Hi all. Here's an issue I've discovered. Using Firefox or Chrome, if you're logged out and close the browser, the next time you open the browser and select an ad (in this case the ad takes you to a local thread), it adds session ID information to the path. If you go back to the main page (where the ad is located) and select the ad again, the session ID info is no longer added and takes you directly to the href link. Is there any way to avoid the session ID when first accessing the site? There's only the one ad in the right column as shown in the following link.

http://www.ussgrahamcounty.com/graco/index.php
SMF 2.0.11

Arantor

That's not specific to this mod - that's something SMF does to *every* link that's referencing the forum. Changing that has some... interesting... consequences.
Holder of controversial views, all of which my own.


Chen Zhen

#474
I am not sure if this is relevant to anyone's issues that I have read in this thread but I will post a code fix for this mod.

The edit to the /Sources/Subs.php file is missing a require command prior to calling one of the mods function. I noticed this today while fixing someone's forum as their php error log (file) was showing unknown function errors.

I will include a bit of extra code to ensure a proper reference.

File: /Sources/Subs.php

find:

// Ends execution.  Takes care of template loading and remembering the previous URL.
function obExit($header = null, $do_footer = null, $from_index = false, $from_fatal_error = false)
{
global $context, $settings, $modSettings, $txt, $smcFunc;


replace with:

// Ends execution.  Takes care of template loading and remembering the previous URL.
function obExit($header = null, $do_footer = null, $from_index = false, $from_fatal_error = false)
{
global $context, $settings, $modSettings, $txt, $smcFunc, $sourcedir;
require_once($sourcedir . '/Subs-Ads.php');


My SMF Mods & Plug-Ins

WebDev

SMF support staff should be shaping a positive community experience & not provoking an argument or emotional reaction.

El.Ultimo.Anunnaki

Hi [SiNaN] !

Im testing this mod on my website...

Can see this screenshot and tell me if are posible move the ad outside the portal on the right side???

Thanks!!!

Attached screenshot...


blue_shadow

#476
Would someone find it in their heart to help me add a profile option for users to enable ads to "support the site"? I currently have ads disabled for users logged in, to keep them happy, but if some want to enable them, I'm not sure where I'd add code.

jekwusky

Please help me. I installed this mod and guess what... I wanna cry. My forum has gone down displaying "Unable to load the 'adsheaders_above' template". I have gone inside the cpanel to delete the simple ads mod, yet the problem persist. Please help me rectify this issue. It is a growing forum with large number of members. forget to backup. Thanks in advance
My site is hxxp:naijapot.com [nonactive]


nikan

#478
Great mod.
Here is the Greek translation.

This is for the existing installation .xml file.
<file name="$languagedir/Modifications.greek.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// SimpleAds
$txt['sa_admin_cat_title'] = 'SimpleAds';
$txt['sa_admin_title'] = 'Διαφημίσεις';
$txt['sa_admin_desc'] = 'Σε αυτή την περιοχή μπορείτε να διαχειριστείτε τις διαφημίσεις και τις θέσεις.';
$txt['sa_ads_list_title'] = 'Λίστα διαφημίσεων';
$txt['sa_ads_add_title'] = 'Προσθήκη διαφήμισης';
$txt['sa_ads_edit_title'] = 'Επεξεργασία διαφήμισης';
$txt['sa_positions_list_title'] = 'Λίστα θέσεων';
$txt['sa_positions_add_title'] = 'Προσθήκη θέσης';
$txt['sa_positions_edit_title'] = 'Επεξεργασία θέσης';
]]></add>
</operation>
</file>


This is for a separate installation .xml file that need to be utf-8 encoded.
<file name="$languagedir/Modifications.greek-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[
// SimpleAds
$txt['sa_admin_cat_title'] = 'SimpleAds';
$txt['sa_admin_title'] = 'Διαφημίσεις';
$txt['sa_admin_desc'] = 'Σε αυτή την περιοχή μπορείτε να διαχειριστείτε τις διαφημίσεις και τις θέσεις.';
$txt['sa_ads_list_title'] = 'Λίστα διαφημίσεων';
$txt['sa_ads_add_title'] = 'Προσθήκη διαφήμισης';
$txt['sa_ads_edit_title'] = 'Επεξεργασία διαφήμισης';
$txt['sa_positions_list_title'] = 'Λίστα θέσεων';
$txt['sa_positions_add_title'] = 'Προσθήκη θέσης';
$txt['sa_positions_edit_title'] = 'Επεξεργασία θέσης';
]]></add>
</operation>
</file>


This is to be saved in two files, ManageAds.greek.php and ManageAds.greek-utf8.php
<?php
// Version: 1.0.1; ManageAds

// Important! Before editing these language files please read the text at the top of index.english.php.

// Ads
$txt['sa_ads_name'] = 'Όνομα';
$txt['sa_ads_body_template'] = 'Πρότυπο σώματος';
$txt['sa_ads_body'] = 'Σώμα';
$txt['sa_ads_status'] = 'Κατάσταση';

$txt['sa_ads_click_limit'] = 'Όριο των κλικ';
$txt['sa_ads_impression_limit'] = 'Όριο εμφανίσεων';
$txt['sa_ads_expiration'] = 'Λήξη';
$txt['sa_ads_created'] = 'Δημιουργήθηκε';

$txt['sa_ads_positions'] = 'Θέσεις';
$txt['sa_ads_membergroups'] = 'Ομάδες μελών';
$txt['sa_ads_actions'] = 'Ενέργειες';
$txt['sa_ads_boards'] = 'Πίνακες';
$txt['sa_ads_custom_display'] = 'Προσαρμοσμένη εμφάνιση';

$txt['sa_ads_clicks'] = 'Κλικ';
$txt['sa_ads_impressions'] = 'Εμφανίσεις';
$txt['sa_ads_expires'] = 'Λήγει';

$txt['sa_no_ads'] = 'Δεν έχουν δημιουργηθεί διαφημίσεις.';

// Positions
$txt['sa_positions_name'] = 'Όνομα';
$txt['sa_positions_namespace'] = 'Όνομα χώρου';
$txt['sa_positions_type'] = 'Τύπος';

$txt['sa_positions_notice_title'] = 'H θέση δημιουργήθηκε';
$txt['sa_positions_notice_body'] = '<p>H θέση δημιουργήθηκε με επιτυχία!</p><p>Για να εμφανίσετε τις διαφημίσεις στη θέση που δημιουργήθηκε, προσθέστε την ακόλουθη παράμετρο στο σημείο όπου θέλετε οι διαφημίσεις να εμφανίζονται:<br /><br /><code class="bbc_code">template_ad_position(\'%1$s\');</code></p>';
$txt['sa_no_positions'] = 'Δεν έχουν δημιουργηθεί θέσεις.';

// Generic
$txt['sa_generic_actions'] = 'Ενέργειες';
$txt['sa_generic_continue'] = 'Συνέχεια';
$txt['sa_generic_edit'] = 'Επεξεργασία';
$txt['sa_generic_delete'] = 'Διαγραφή';

$txt['sa_generic_active'] = 'Ενεργό';
$txt['sa_generic_disabled'] = 'Ανενεργό';

$txt['sa_generic_expired'] = 'Έληξε';
$txt['sa_generic_never'] = 'Ποτέ';

$txt['sa_generic_membergroup'] = 'Ομάδα μέλους';
$txt['sa_generic_groups_allow'] = 'Ε';
$txt['sa_generic_groups_disallow'] = 'Δ';
$txt['sa_generic_groups_deny'] = 'Α';

$txt['sa_generic_expire_days'] = 'Ημέρα(ες)';
$txt['sa_generic_expire_months'] = 'Μήνας(ες)';
$txt['sa_generic_expire_years'] = 'Έτος(η)';

$txt['sa_generic_board_index'] = 'Ευρετήριο πίνακα';

$txt['sa_generic_plain'] = 'Απλό';
$txt['sa_generic_rotating'] = 'Περιστρεφόμενο';

// Erros
$txt['sa_error_empty_name'] = 'Αφήσατε το πεδίο ονόματος άδειο.';
$txt['sa_error_empty_body'] = 'Αφήσατε το πεδίο σώματος άδειο.';
$txt['sa_error_empty_namespace'] = 'Αφήσατε το πεδίο ονόματος χώρου άδειο.';
$txt['sa_error_duplicate_namespace'] = 'Το όνομα χώρου που επιλέξατε χρησιμοποιείται. Το όνομα χώρου πρέπει να είναι μοναδικό.';
$txt['sa_error_invalid_namespace'] = 'Το όνομα χώρου μπορεί να περιέχει μόνο γράμματα, αριθμούς και κάτω παύλες.';

?>


This is for Greek translation of stings in database. Save as database.php for package installation.
<?php

if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!
defined('SMF'))
die('<b>Error:</b> Cannot install - please verify you put this in the same place as SMF\'s index.php.');

global
$smcFunc;

$default_positions = array(
array(
'name' => 'Στην επικεφαλίδα',
'namespace' => 'overall_header',
),
array(
'name' => 'Στο υποσέλιδο',
'namespace' => 'overall_footer',
),
array(
'name' => 'Κάτω από το μενού',
'namespace' => 'below_menu',
),
array(
'name' => 'Πάνω από το κέντρο πληροφοριών',
'namespace' => 'above_info_center',
),
array(
'name' => 'Πάνω από το υποσέλιδο',
'namespace' => 'above_footer',
),
array(
'name' => 'Αριστερή πλευρά',
'namespace' => 'left_side',
),
array(
'name' => 'Δεξιά πλευρά',
'namespace' => 'right_side',
),
array(
'name' => 'Μετά την πρώτη δημοσίευση',
'namespace' => 'after_first_post',
),
array(
'name' => 'Μέσα στην πρώτη δημοσίευση',
'namespace' => 'inside_first_post',
),
array(
'name' => 'Μετά την τελευταία δημοσίευση',
'namespace' => 'after_last_post',
),
);

foreach (
$default_positions as $value)
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}sa_positions
SET name = {text:name}
WHERE namespace = {text:namespace}'
,
array(
'name' => $value['name'],
'namespace' => $value['namespace'],
)
);
}

if (
SMF == 'SSI')
echo 'Database adaptation successful!';

?>

Realinfo

How to decrease distance of ads from link tree as shown in attachment

please guide

2.0.4 default theme

Advertisement: