Welcome to Geeklog, Anonymous Tuesday, November 26 2024 @ 01:45 am EST
Geeklog Forums
Edit button on stories for admins
jim
if( SEC_hasAccess( $A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'] ) == 3 AND SEC_hasrights( 'story.edit' ))
{
$article->set_var( 'edit_link', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=edit&sid=' . $A['sid'] . '">' . $LANG01[4] . '</a>' );
$article->set_var( 'edit_icon', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=edit&sid=' . $A['sid'] . '">' . '<img src= "' . $_CONF['layout_url'] . '/images/edit.gif" alt="edit" border=0>' . '</a>' );
}
if( SEC_hasAccess( $A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'] ) == 3 AND SEC_hasrights( 'story.edit' ))
{
$article->set_var( 'edit_link', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=edit&sid=' . $A['sid'] . '">' . $LANG01[4] . '</a>' );
$article->set_var( 'edit_icon', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=edit&sid=' . $A['sid'] . '">' . '<img src= "' . $_CONF['layout_url'] . '/images/edit.gif" alt="edit" border=0>' . '</a>' );
}
Ectropian
--Ted(Ectropian)
jim
So, here's the details. In your storytext.thtml file in the theme of your choice (geeklog/public_html/layout/yourtheme/storytext.thtm) add an {edit_icon} value where ever you like.
This is the original code from lib-common.php:
if( SEC_hasAccess( $A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'] ) == 3 AND SEC_hasrights( 'story.edit' ))
{
$article->set_var( 'edit_link', '<a href="' . $_CONF['site_admin_url'] . '/story.php?mode=edit&sid=' . $A['sid'] . '">' . $LANG01[4] . '</a>' );
}
This whole thing makes me think that the owner of a story should be able to modify it. My story up there is messed up and needs fixing. The owner and anybody in the story admin group should be able to modify it's content.
I'm doing this same thing to get a "read more" icon. I haven't posted the hack yet though.
Ectropian
Problem I see with most of these hacks like this is that they need to be meticulously readded after each upgrade. I wonder if GL would consider encorporating this as a standard? Maybe I will add it to the wish-list
I have created a neat edit icon for anyone who wishes to use it with this hack.
--Ted(Ectropian)
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content