Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Core Labs / Archive / add "item available" to list.php

#1 2009-12-31 04:46
In i do not see the following code.. (see for the same code)
It would be nice to add it there. That way I can detect if a page should be on the list or not. Also I want to show the "NON" published items to admins and owners only.
Also I made 1 tag in page called "PAGE_AVAILABLE" that i can use in xtemplate to make my skin programming simpler.. (and would like that in list too)
The PAGE_AVAILABLE tag i also added to

Tell me what you all think....

In (2 tiny corehacks):
// LLS start modification	
if ($pag['page_begin']>$sys['now_offset'])
	$pag['page_text'] = $L['pag_notavailable'].sed_build_timegap($sys['now_offset'], $pag['page_begin_noformat']);
	$t->assign("PAGE_TEXT", $pag['page_text']);
// LLS modification	
	$t->assign("PAGE_AVAILABLE", "0");
	$t->assign("PAGE_AVAILABLE", "1");

// LLS END modification

==- I say: Keep it EZ -==

This post was edited by ez (2009-12-31 17:30, 10 years ago)
#2 2009-12-31 04:48
You have a working example m8?
[b][/b]<br />
De plaats voor nederlandse ondersteuning voor Cotonti.<br />
The place for support for Cotonti in Dutch
#3 2009-12-31 17:02
I am buidling a community site for chessplayers in the Netherlands...
My demo site (still not live) is at

I use this as follows:
<!-- BEGIN: LIST_ROW -->
	<!-- IF {LIST_ROW_IAMTHEOWNER}="1" OR {PAGE_AVAILABLE}="1" OR {PHP.usr.isadmin}="1" -->
			<h4><a href="{LIST_ROW_URL}">{LIST_ROW_TITLE}</a></h4>
			<p class="small">{LIST_ROW_DESC}</p><br />
			<!-- IF {IMGR1_SRC} -->
				<a href="{LIST_ROW_URL}"><img width="{IMGR1_WIDTH}" height="{IMGR1_HEIGHT}" alt="Kunst" title="{LIST_ROW_TITLE}" src="{IMGR1_SRC}"/></a>
			<!-- ENDIF -->
	<!-- ENDIF -->
<!-- END: LIST_ROW -->

there are a few tags in here that are mine:
{IMGR1_xxx} is a custom plugin I build for resizing imgs to different sizes in different places.
{PAGE_AVAILABLE} Code is in first post:
{LIST_ROW_IAMTHEOWNER} also a new tag i build:
"LIST_ROW_IAMTHEOWNER" => $usr['id']==$pag['page_ownerid'] ? '1' : '0',	

Anyway i think this could be usefull for the next version (maybe)???
==- I say: Keep it EZ -==

This post was edited by ez (2009-12-31 17:28, 10 years ago)
#4 2009-12-31 17:48
I don't see any reason to add this to core sorry, its something totaly custom.

The IAMTHEOWNER could be done via tpl.
The page avail you should be able to do via Custom fields and TPL
Same for the Image thing, can be done with extra fields
#5 2009-12-31 18:02
Hi Kilandor,
thnx for the response :)
How can i do this: "The IAMTHEOWNER could be done via tpl."

For the other items, i cannot use xtra fields (in this case)
Still this part:
# if ($pag['page_begin']>$sys['now_offset'])
# {
#     $pag['page_text'] = $L['pag_notavailable'].sed_build_timegap($sys['now_offset'], $pag['page_begin_noformat']);
#     $t->assign("PAGE_TEXT", $pag['page_text']);
#     }
# else
# {

Is in page,inc.php, but not in ??
So maybe this should be there ???? (why in page and not in list)
==- I say: Keep it EZ -==
#6 2010-01-01 18:56
<!-- IF {}={PHP.pag.page_ownerid} OR {PAGE_AVAILABLE}="1" OR {PHP.usr.isadmin}="1" -->
That should work