Go Back   Pligg Forum > Pligg Help > General Help
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2007, 03:22 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
How to identify the index page?

how to identify if the page is the index page - ie the page displayed is http://www.domain.com/index.php or http://www.domain.com/

or if it is the first page of the published news?

Any help is really appreciated. TIA
Reply With Quote
Sponsored Links
Check out the New Modules at the Pligg Pro Shop.
  #2 (permalink)  
Old 06-25-2007, 08:05 AM
Yankidank's Avatar
Yankidank Yankidank is online now
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Pligg Founder
Pligg Version: SVN
Pligg Template: MacBlue
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 1,630
Downloads: 65
Uploads: 6
Thanks: 104
Thanked 166 Times in 113 Posts
I'm not entirely sure what you're asking. Do you want to know how to display certain information only on the index page and want to wrap an {if} tag around it?
Code:
 {if $pagename eq "index" }
{/if}
__________________
Need a Pligg Host?
Get 3 free months
when you buy a year of hosting.
Use the coupon PLIGG at either...
MidPhase hosting starting at $7.95/month.
ANhosting hosting starting as low as $4.95/month.
Reply With Quote
  #3 (permalink)  
Old 06-25-2007, 09:00 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
Thanks for the reply, me too tried the same, but the index.php has the $pagename as "published" instead of "index" - so the code does not work. I use 9.6 from Sourceforge.

Is it fine If I change the name back to "index" in index.php - I am not sure which version this was changed - with pre 9.x version there is an $pagename "index" - was that change intentional?
Reply With Quote
  #4 (permalink)  
Old 06-25-2007, 09:27 AM
Yankidank's Avatar
Yankidank Yankidank is online now
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Pligg Founder
Pligg Version: SVN
Pligg Template: MacBlue
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 1,630
Downloads: 65
Uploads: 6
Thanks: 104
Thanked 166 Times in 113 Posts
I just used the {if $pagename eq "index" } code a week ago on a 9.6 template, it has to work. I guess I'm just misunderstanding something.
__________________
Need a Pligg Host?
Get 3 free months
when you buy a year of hosting.
Use the coupon PLIGG at either...
MidPhase hosting starting at $7.95/month.
ANhosting hosting starting as low as $4.95/month.
Reply With Quote
  #5 (permalink)  
Old 06-25-2007, 10:04 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
Enclosed is the /index.php from the package located at http://sourceforge.net/project/showf...ease_id=511871

lines 85-87 has the following code:
Code:
// pagename	
define('pagename', 'published'); 
$main_smarty->assign('pagename', pagename);
If the reason for changes is indicated - it would be assured that i can revert back it to "index" and carry on.

Thanks for all help.
Attached Files
File Type: php index.php (3.9 KB, 13 views - Who Downloaded?)
Reply With Quote
  #6 (permalink)  
Old 06-26-2007, 01:34 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
Am still confused why this was changed this way? any help is appreciated.
Reply With Quote
  #7 (permalink)  
Old 06-26-2007, 08:39 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
I just searched the SVN - to find this interesting - kb has changed the index page to published page in revision 1005 on April 28, 2007 http://pligg.svn.sourceforge.net/vie...r1=891&r2=1005

I just tried changing the $pagename in index.php - but the effect is that if any category is selected - it passes the if $pagename eq "index" test - totally struck.

Thanks for any help on this.
Reply With Quote
  #8 (permalink)  
Old 06-28-2007, 07:48 AM
beatniak's Avatar
beatniak beatniak is offline
Pligg Dev/MB creator
 
Join Date: Apr 2006
Location: NL - 52.100863;5.108356
Posts: 310
Downloads: 34
Uploads: 0
Thanks: 14
Thanked 77 Times in 48 Posts
index.php.... line 39/40 says:
Code:
// figure out what "page" of the results we're on
$search->offset = (get_current_page()-1)*$page_size;
so give that var to smarty:
Code:
 $main_smarty->assign('pagenumber', $search->offset);
(or something like that)

use it in your template:

Code:
{if $pagename eq 'published'}
{if $request_category eq ""}
{if $pagenumber eq "0"}this is the homepage{/if}
{/if}
{/if}
__________________
Like my work? Donations are welcome if you would like to support my work!
Finger pliggin' good sites of mine: receptencocktail.nl / numarketing.nl / goboz.com

Last edited by beatniak : 06-28-2007 at 08:51 AM. Reason: minor code typo
Reply With Quote
The Following User Says Thank You to beatniak For This Useful Post:
  #9 (permalink)  
Old 06-28-2007, 07:49 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
thanks steef:

just changed it a bit to teh following code:
Code:
{if $pagename eq "published" and $request_category eq "" and $pagenumber eq 0}
	this is home
{/if}
Reply With Quote
The Following User Says Thank You to dollars5 For This Useful Post:
  #10 (permalink)  
Old 06-28-2007, 08:00 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,164
Downloads: 29
Uploads: 1
Thanks: 292
Thanked 267 Times in 178 Posts
Thanks again steef, it works like a pro - i had been bugging on this for 2 days and didnt pass on - dunno how I missed basic simple steps - should have relaxed before thinking fresh :)
Reply With Quote
Reply



Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
full story (not summary) on index page revolver General Help 2 06-24-2007 10:03 AM
not appear the Avatar in the index page Question trh792 General Help 2 03-31-2007 06:57 PM
Display Top Users in Index page scasey Pligg Templates 0 07-02-2006 02:03 AM
tag cloud on index page solutionsphp "Mollio-Beat" 2 06-17-2006 01:16 PM
/var/log/httpd/error_log messages gr8rcake Bug Report 3 01-28-2006 08:28 PM


LinkBacks Enabled by vBSEO 3.0.0