cotonti.com : Make news editable on homepage https://www.cotonti.com Останні повідомлення в темі Cotonti en Sun, 11 Jan 2026 08:57:23 -0000 foxhound


[edit]
To explain.
Our live site is still running Seditio, that is where I converted the DB from (or can pick a new one from any time I want to convert that one).
The DB which is currently used is a few months old. Converting the DB is a very long process for me so I choose not to do it every week ;)

We never went live yet with our Cotonti site since we are reworking our whole site as well at the same time, its just a test site running on Cotonti nobody has acces to.]]>
Thu, 26 Лис 2009 03:56:13 -0000
Kilandor Thu, 26 Лис 2009 03:17:48 -0000 foxhound # Kilandor : Goto Others > Disk Cache and Delete the templates cache see if that helps.

Something must be really wrong here, I do not have that option under "other". The only thing I can choose is "Internal cache".
However, I always just manually empty the templates cache (in datas), I guess thats the same right?

I am going to take someones offer and ask him to convert our Seditio DB to Cotonti. Somewhere during the process things go wrong but I have no idea why (I followed the tuts every time step by step to the letter).]]>
Ср, 25 Лис 2009 17:53:20 -0000
Kilandor Ср, 25 Лис 2009 13:57:34 -0000 foxhound If I than add the
<!-- IF {PHP.usr.isadmin} -->
	<a href=https://www.cotonti.com/"page.php?m=edit&id={PAGE_ROW_ID}&r=list">Edit</a>
<!-- ENDIF -->
to my news.tpl there still is no way to edit the news directly.

I am using the latest version of cotonti. Site is not public though, its in maintenance mode.

If you want I can give you acces to the site so you can see it for yourself, you can get the head admin acces info if you want. Just so you can check all rights.]]>
Вт, 24 Лис 2009 20:35:00 -0000
Kort <!-- IF {PHP.usr.isadmin} --> <a href=https://www.cotonti.com/"page.php?m=edit&id={PAGE_ROW_ID}&r=list">Edit</a> <!-- ENDIF -->in plugins/news.tpl on a live site under 0.6.5. Works fine (as it should).
1. Try to login as admin
or
2. Group "42" has no admin privileges]]>
Вт, 24 Лис 2009 19:22:52 -0000
foxhound

But, none of the above works, I added both ways to my news.tpl in the /skins/Blaster07/plugins/ folder but still there is no edit option for admins.
And before anyone asks. Yes, I am an admin there. :)

Here is how the tpl looks now:
<!-- BEGIN: NEWS -->
<!--Seditio Skin T3 Blaster 07 Copyright © 2007 T3-Design.Com. All rights Reserved. -->

<!-- BEGIN: PAGE_ROW -->

<div class="{PAGE_ROW_AUTHOR}">
	<div id="{PAGE_ROW_KEY}" >
		<div style="float:left; height:25px; padding:4px 0 3px 57px">&nbsp; <a href=https://www.cotonti.com/"{PAGE_ROW_URL}">{PAGE_ROW_SHORTTITLE}</a> </div><div style="float:right; height:25px; padding:4px 0 3px 0px">{PAGE_ROW_CATICON}</div><div style="clear: both;"></div>
	</div>
	<div id="fondonews">
		<div style="float:left;"> {PAGE_ROW_CATPATH} </div>
		<div style="float:right">{PAGE_ROW_COMMENTS} {PAGE_ROW_ADMIN}</div>
	</div>
<br>{PAGE_ROW_TEXT}<br><br>
	<div id="fondonews">
		<span style="float:left;">Written on {PAGE_ROW_DATE} by {PAGE_ROW_OWNER}</span>
		<span style="float:right">test2</span>
<!-- IF {PHP.usr.isadmin} -->
	<a href=https://www.cotonti.com/"page.php?m=edit&id={PAGE_ROW_ID}&r=list">Edit</a>
<!-- ENDIF -->

<!-- IF {PHP.usr.profile.user_maingrp} == '42' -->
	<a href=https://www.cotonti.com/"page.php?m=edit&id={PAGE_ROW_ID}&r=list">Edit</a>
<!-- ENDIF -->
		
		
		
	</div>
</div>

<!-- END: PAGE_ROW -->
<!-- BEGIN: HEADLINES_ROW -->
<div class="{PAGE_ROW_ODDEVEN}">{PAGE_ROW_DATE} : {PAGE_ROW_CATPATH_IDX} {PHP.cfg.separator} <a href=https://www.cotonti.com/"{PAGE_ROW_URL_IDX}">{PAGE_ROW_SHORTTITLE}</a></div>
<!-- END: HEADLINES_ROW -->

<div class="paging">{PAGE_PAGEPREV} {PAGE_PAGENAV} {PAGE_PAGENEXT}</div>

<!--Seditio Skin T3 Blaster 07 Copyright © 2007 T3-Design.Com. All rights Reserved. -->
<!-- END: NEWS -->



[edit]
"Test2" is only just there for making sure to me I am editing the correct tpl. Same as the location, this is just to see if i can get it to work, after that I put it in a <div>


[edit2]
Uhm, no idea, but now it works correct.
But only by using the way how musiconly told how he did it. That default "isadmin" block does not work. Maybe for that one you need to be user=1?]]>
Вт, 24 Лис 2009 16:49:41 -0000
Kort <!-- IF {PHP.usr.isadmin} --> <a href=https://www.cotonti.com/"page.php?m=edit&id={PAGE_ROW_ID}&r=list">Edit</a> <!-- ENDIF -->]]> Вт, 24 Лис 2009 05:47:53 -0000 pieter Only finding the right variable is my problem.

Is there a list with the variables?
Also is there a lost of all TPL tags?
Because in http://www.cotonti.com/plug.php?e=tpltags there are some missing.
Like news.tpl, index.tpl, ..]]>
Вт, 24 Лис 2009 02:39:24 -0000
musiconly
skins/yourkin/plugins/news.tpl

add somewhere in it, between <!-- BEGIN: PAGE_ROW --> <!-- END: PAGE_ROW -->:
<!-- IF {PHP.usr.profile.user_maingrp} == '5' -->
	<a href=https://www.cotonti.com/"page.php?m=edit&id={PAGE_ROW_ID}&r=list">Edit</a>
<!-- ENDIF -->

Power of logic blocks :D]]>
Вт, 24 Лис 2009 01:47:59 -0000
foxhound So, at the moment I am editing the news.function.php in the news plugin folder and added this (and a lot of other tries but I think this is the best and I should almost be there):
	// Added to enable editing of pages on homepage
	if ($usr['isadmin'] || $usr['id'] == $pag['page_ownerid'])
	{
	$news-> assign("PAGE_ROW_ADMIN_EDIT", "<a href=https://www.cotonti.com/\"".sed_url('page', 'm=edit&id='.$pag['page_id'].'&r=list')."\">".$L['Edit'].'</a>');
	}

But, it generates an error:
Fatal error: Call to a member function assign() on a non-object in /home/armaholi/public_html/testers/armaholictest/plugins/news/inc/news.functions.php on line 55

So, after some more tinkering I figured I needed to add this:
	// Added to enable editing of pages on homepage
	list($usr['auth_read'], $usr['auth_write'], $usr['isadmin']) = sed_auth('page', 'any');
sed_block($usr['auth_read']);

	// Added to enable editing of pages on homepage
	list($usr['auth_read'], $usr['auth_write'], $usr['isadmin'], $usr['auth_download']) = sed_auth('page', $pag['page_cat'], 'RWA1'); 
As it is refering to a member (rights?).
But still no joy, the admin can still not edit the news on the homepage.
Anyone able and willing to tell me what I am doing wrong?]]>
Нд, 22 Лис 2009 23:17:44 -0000