TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,947
  • Latest: sgm09
Stats
  • Total Posts: 195,764
  • Total Topics: 21,279
  • Online today: 369
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 365
  • Total: 365

Selected Topics on Frontpage

Started by oldfuturecrash, April 13, 2010, 01:36:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

oldfuturecrash

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.

bloc

Only those with "tp_settings" permission are allowed to.

Are you thinking to let normal users promote topics..?

oldfuturecrash

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  :)

oldfuturecrash

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');
}


bloc

Yes..but you will need an interface to select who can promote. I'll see if that can be added as a feature.

oldfuturecrash

oks!  :-\    thanks, anyway!   :)

This website is proudly hosted on Crocweb Cloud Website Hosting.