Author Topic: Admin Plugin for Enable/Disable Ads Code?  (Read 16283 times)

0 Members and 1 Guest are viewing this topic.

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Admin Plugin for Enable/Disable Ads Code?
« on: May 02, 2013, 04:05:46 AM »
Hello friends

Is there a way to disable-Enable Adsence code or any advertisement code for particular images only through admin control panel? I found some tags which disable or enable particular functions but those tags do that for whole site. But i want for particular pages only.

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #1 on: May 02, 2013, 08:39:54 AM »
hi kar!
yes that is easily possible.
just build up a custom field for images (e.g. called ads)... this field you can then specifically edit in admin panel as you want.
greetz,
bergblume

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #2 on: May 02, 2013, 11:39:06 PM »
Hello bergblume :)

First thanks for reply and help

I did what suggested on page "http://www.4homepages.de/forum/index.php?topic=30264.0"

But that isn't working. I put adsense code in text area and it not visible, i think javascript causing problem.

Then i try radio button option instead of text field, for yes/no option. So i created two tags 

{if adsense} Show Adsense Code  {endif adsense}    for yes option
{ifnot adsense} Hide Adsense Code {endifnot adsense}  for no option

But i don't know how to link these tags with yes or no option in Control Panel

Can you solve this problem?

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #3 on: May 03, 2013, 01:00:13 PM »
hi!

it could be that for your adcode the character line is too short...

try VARCHAR( 5000 ) NOT NULL;

instead of VARCHAR( 255 ) NOT NULL;

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #4 on: May 03, 2013, 08:26:36 PM »
I did what you suggest but its still doesn't work.

------------------------------------------------------------------------------------------

I also did a little trick.  I created two text field in CP. In fist filed i put {ifnot adsense}

In second field  put {endifnot adsense}

And in my html file did this  {image_photograph}Advertisement code{image_photograph2}

But tags not doing their work. I thought its some mistake so i replace {ifnot adsense} , {endifnot adsense}

with some text and those text appeared around advertisement code.

I wonder why tags isn't working.
« Last Edit: May 03, 2013, 08:38:18 PM by kar76 »

Rembrandt

  • Guest
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #5 on: May 03, 2013, 08:37:59 PM »
Hi!
Is there always the same adsense code?

mfg Andi

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #6 on: May 03, 2013, 09:35:08 PM »
Yes, in every page same adsense code.
I use tags around 468x60 advertisement.

I wonder why tags isn't working. I can see adsence code by View Page Source  in browser.
Those tags must hide adsence code but only tags hide adsence code appears.
But when i use them directly in html files they hide adsence code.

Rembrandt

  • Guest
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #7 on: May 05, 2013, 05:18:22 PM »
1.) add in your DB:
Code: [Select]
ALTER TABLE 4images_images ADD image_ads TINYINT(1) DEFAULT '0' NOT NULL

2.) add in db_field_definitions.php :

$additional_image_fields
['image_ads'] = array($lang['image_ads'], "radio"0);


3.) add in lang/main.php:

 $lang
['image_ads'] = "View Adsence :";


4.) add in your details.html:
Code: [Select]
{if image_ads}
  your ads code....
{endif image_ads}

mfg Andi

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #8 on: May 05, 2013, 08:09:43 PM »
Its perfect  :D
This is what i can say
great help

Rembrandt

  • Guest
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #9 on: May 05, 2013, 08:13:25 PM »
 :thumbup:

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #10 on: May 05, 2013, 11:01:57 PM »
I just realize that its only for images, its not for category

How about category?  :)

Offline kar76

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #11 on: May 18, 2013, 10:53:52 PM »
I try above code for categories but no luck, its not working for categories. :(

Does anyone know, how to implement Rembrandt code for categories?

Rembrandt

  • Guest
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #12 on: May 20, 2013, 05:09:18 PM »
Hi!
...Does anyone know, how to implement Rembrandt code for categories?
yes, I myself. :)
http://www.4homepages.de/forum/index.php?topic=31232.0

mfg Andi

Offline sunl

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Admin Plugin for Enable/Disable Ads Code?
« Reply #13 on: March 09, 2015, 09:28:24 AM »
Code: [Select]
{if image_ads}
  your ads code....
{endif image_ads}
This tag isn't working in multi_popup.html window mode.
I think multi-popup mod belongs to download.php file.
I even try to put conditional tag in download.php but it show enabled code but not disable code.
How to configure download.php so this mode work there too?

 

Post your comments here