SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2006
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing page elements using javascript

    Hi,

    I know nothing about javascript or databases but I'll try and explain what I'm trying to do as best I can and hopefully someone can help .

    I have a site that runs using an article directory script. As it runs using templates all of the pages look the same with adsense running in them. However, I would like to remove adsense from pages under certain categories.

    When I go into PHPMyAdmin to view the database the 'field' that has the category is called "category_id".

    I can't include PHP in the templates so is there anyway that I could remove adsense using javascript for categories. I'm guessing it would need some sort of script where "articles under category X" will not display the adsense ads.

    Any help or suggestions would be great.

    Thanks in advance,
    Justin.

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if this can work, but maybe you can put the adsense code in a div and using css you can alternatively switch either it's visibility:hidden or visible (or maybe using display:none/inline property).

    Anyway, I don't think this is a good method to your case. Usually for a script that providing template system, you *can* remove some of unwanted block of code, maybe not using PHP command in the template, instead it has their own "if" statement. However, if the script doesn't support it, I think the best way is taking a look at the PHP code itself and make some adjustment (well sorry to say this but if this is the case, you seem to have a script that's not good enough). Hope you find the best way


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •