Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

May 24, 2022, 12:00:08 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 193371
  • Total Topics: 21076
  • Online today: 58
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 40
Total: 40

Author Topic: Selected Topics on Frontpage  (Read 3267 times)

0 Members and 1 Guest are viewing this topic.

oldfuturecrash

  • Guest
Selected Topics on Frontpage
« on: April 13, 2010, 06:36:42 AM »
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.

Offline bloc

  • Founder
  • *
  • Posts: 5229
    • Bloc
Re: Selected Topics on Frontpage
« Reply #1 on: April 13, 2010, 06:43:43 AM »
Only those with "tp_settings" permission are allowed to.

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

oldfuturecrash

  • Guest
Re: Selected Topics on Frontpage
« Reply #2 on: April 13, 2010, 07:08:46 AM »
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

  • Guest
Re: Selected Topics on Frontpage
« Reply #3 on: April 14, 2010, 08:33:01 AM »
Hi Bloc, I guess there's something to do with that code.

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

Code: [Select]
}
// 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');
}

Offline bloc

  • Founder
  • *
  • Posts: 5229
    • Bloc
Re: Selected Topics on Frontpage
« Reply #4 on: April 15, 2010, 12: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.

oldfuturecrash

  • Guest
Re: Selected Topics on Frontpage
« Reply #5 on: April 15, 2010, 02:17:42 PM »
oks!  :-\    thanks, anyway!   :)