General 'if' statement question

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2007, 11:08 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 168
This is truly a beginner type question. If I only wanted to display something only the 'homepage' aka 'index.php', what would the if statement look like?

I want to display a 'Poll Module'. Here is the existing code; I just need help to add an if statement to it so the poll only displays on the home page.

<?php
include_once "/home/content/a/a/r/aaronpais/html/poll/db/booth.php";
echo $php_poll->poll_process(4);
?>

Thx so much
Reply With Quote
  #2 (permalink)  
Old 05-07-2007, 11:25 PM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
If you put it in index_center.tpl then it'll only show on the homepage. If you put it inside pligg.tpl then you'll do this...

PHP Code:
{if $pagename eq 'index'}

{
php}
include_once 
"/home/content/a/a/r/aaronpais/html/poll/db/booth.php";
echo 
$php_poll->poll_process(4);
{/
php}

{/if} 
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google adsense revenue sharing, question dadaas Questions and Comments 2 03-30-2011 07:01 AM
[MOD] Categories in header like Digg (useful if you have subcategories) dollars5 Questions and Comments 142 06-01-2009 09:24 AM
Pull a profile field into story - General PHP question fordp Questions and Comments 6 07-07-2007 03:07 PM
Beta 9.1 question bizdiggers Questions and Comments 23 02-27-2007 01:30 PM
A General Question mskonfa Questions and Comments 2 03-31-2006 01:37 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development