TinyPortal

Development => Support => Topic started by: oldfuturecrash on April 13, 2010, 01:36:42 PM

Title: Selected Topics on Frontpage
Post by: oldfuturecrash on April 13, 2010, 01:36:42 PM
Hi guys! just one question, I've been testing with that new version and I wonder if regular users could see he button placed on the topic page "Add to frontpage". I can see it while logged as admin, but not as regular user. Is something to change in the permissions or it has to be tone codding? Thanks in advance.
Title: Re: Selected Topics on Frontpage
Post by: bloc on April 13, 2010, 01:43:43 PM
Only those with "tp_settings" permission are allowed to.

Are you thinking to let normal users promote topics..?
Title: Re: Selected Topics on Frontpage
Post by: oldfuturecrash on April 13, 2010, 02:08:46 PM
yes! thats what I want. Well, in fact, no admin groups (mods, users) that only can promote, but no admin settings. thanks for the quick reply  :)
Title: Re: Selected Topics on Frontpage
Post by: oldfuturecrash on April 14, 2010, 03:33:01 PM
Hi Bloc, I guess there's something to do with that code.

I found it in TPmodules.php, on /Sources.

}
// promoting topics
elseif($tpsub=='publish')
{
if(!isset($_GET['t']))
redirectexit('action=forum');

$t = is_numeric($_GET['t']) ? $_GET['t'] : 0;

if(empty($t))
redirectexit('action=forum');

isAllowedTo('tp_settings');
$existing = explode(",",$context['TPortal']['frontpage_topics']);
if(in_array($t,$existing))
unset($existing[array_search($t, $existing)]);
else
$existing[] = $t;

$newstring = implode(",",$existing);
if(substr($newstring,0,1)==',')
$newstring = substr($newstring,1);

tp_query("UPDATE " . $tp_prefix . "settings SET value = '" . $newstring . "' WHERE name='frontpage_topics'", __FILE__, __LINE__);
redirectexit('topic='. $t . '.0');
}

Title: Re: Selected Topics on Frontpage
Post by: bloc on April 15, 2010, 07:23:53 PM
Yes..but you will need an interface to select who can promote. I'll see if that can be added as a feature.
Title: Re: Selected Topics on Frontpage
Post by: oldfuturecrash on April 15, 2010, 09:17:42 PM
oks!  :-\    thanks, anyway!   :)