PHP to display something in sNews ONLY when viewing an article on it's page
Here is a snippet of PHP code for sNews 1.7 to display something (image, text, anything) ONLY when viewing an article on it's stand alone page, not on the home page, regular pages, or category views.
if (empty($currentPage) && !empty($_ID) && $_catID > 0) {
echo "Sweet, this is an article page!";
} else {
echo "Damn, this isn't an article page!";
}
Comments
RSS Comments Feed
alyoung
The best blog about sNews!
jordi
Sven - Philippe
really nice: I was wondering how I could display Google Ads too (later on) and tada! here comes the solution. Thanks a lot.
Have a nice day.
Matt
Sven - Philippe
But... but... this blog is just a playground for SEO and a way to let out the steam of my brain when I get ennoyed by customers.
I never done its promotion so there's a few visitors.
AJ
This mod seems to be almost exactly what I am looking for. If you have the time could you explain how I can get something to show on my articles (as above) and also the homepage. My homepage is always my latest article. The something being adsense of course.
Thanks again for getting me sorted with my missing data last week.
Best,
Andrew
Matt
That can be done, I'll get back to you on Tuesday... I'm away in Washington D.C. until then.
-Matt
Matt
if (empty($currentPage) && (!empty($_ID) && $_catID > 0 || empty($_GET['category']))) { echo "Sweet, this is an article/home page!"; } else { echo "Damn, this isn't an article/home page!"; }Andrew
Sinolog
http://www.calun.pl/calun-turynski/calun-turynski-argumenty-nie/czy-znalezisko-podwazy-mit-calunu...
Nicu Alecu