Welcome to Geeklog, Anonymous Sunday, November 24 2024 @ 12:57 pm EST
Geeklog Forums
Blog Section Hack
Status: offline
ivy
Forum User
Full Member
Registered: 11/25/04
Posts: 314
Location:Tokyo Japan
If you hack admin/story.php , User 'test' can make story in the topic which owner is 'test'. Pull down topic lists are only topics: User 'test' have EDIT right.
and Moderator can create a topic for user 'test' by setting number, by hack to
<public_html>/layout/<theme>/admin/topic/topiceditor.thtml.
Please login http://demo.geeklog.jp user:test password:test,
and make story.
Document: http://wiki.geeklog.jp/index.php/BlogSection_en
Geeklog Japan https://www.geeklog.jp
and Moderator can create a topic for user 'test' by setting number, by hack to
<public_html>/layout/<theme>/admin/topic/topiceditor.thtml.
Please login http://demo.geeklog.jp user:test password:test,
and make story.
Document: http://wiki.geeklog.jp/index.php/BlogSection_en
Geeklog Japan https://www.geeklog.jp
5
7
Quote
Status: offline
mystral-kk
Site Admin
Admin
Registered: 03/19/06
Posts: 100
Location:Japan
To supplement what Ivy said above, I'll write about the way to ensure stroies are editable by non-Root contributors. You may say this is just what the journal plugin is made for, but the plugin doesn't work with register_globals off.
One of Geeklog.jp members suggests the way to allow multiple bloggers who don't belong to the Root group to administer articles easily.
As you know, when you create a story, you can choose ANY topic you have read-access to. In case you are on the Root group, this is natural.
Well, then, suppose you are story-admin and topic-admin but are NOT on the Root group. You can choose ANY topic you have read-access to as well. But once you have posted a story, you can no longer edit or delete it, unless you have write-access to the topic, which is seldom the case with non-Root users. This might be a bit embarrassing to those who are not familiar with Geeklog.
In order to deal with this, how about modifying admin/story.php? As for Geeklog-1.4.0, if you change the line around 657,
COM_topicList ('tid,topic', $A['tid'])
to
CUSTOM_topicList ('tid,topic', $A['tid'])
and in the lib-cusutom.php, add the following:
function CUSTOM_topicList( $selection, $selected='', $sortcol=1 )
{
global $_TABLES;
$retval = '';
$tmp = str_replace( 'DISTINCT ', '', $selection );
$select_set = explode( ',', $tmp );
$result = DB_query( "SELECT * FROM {$_TABLES['topics']}" . COM_getPermSQL( 'where', 0, 3 )
. " ORDER BY $select_set[$sortcol]" );
$nrows = DB_numRows( $result );
for( $i = 0; $i < $nrows; $i++ )
{
$A = DB_fetchArray( $result, true );
$retval .= '<option value="' . $A[0] . '"';
if( $A[0] == $selected )
{
$retval .= ' selected';
}
$retval .= '>' . stripslashes( $A[1] ) . '</option>' . LB;
}
return $retval;
}
Much the same as COM_topicList, except that
[code]
COM_getPermSQL()
is replaced with
COM_getPermSQL( 'where', 0, 3 )
In addition, modify part of <public_html>/layout/theme_name/admin/topic/topiceditor.thtml
from
<td align="right">{lang_owner}:</td>
<td>{owner_username}<input type="hidden" name="owner_id" value="{owner_id}"></td>
to
<td align="right">{lang_owner}:</td>
<td>{owner_username}<input type="text" name="owner_id" value="{owner_id}"></td>
We wish the above hack will be merged into GL's core code.
-- mystral-kk, "Every cloud has a silver lining."
Text Formatted Code
COM_topicList ('tid,topic', $A['tid'])
Text Formatted Code
CUSTOM_topicList ('tid,topic', $A['tid'])
Text Formatted Code
function CUSTOM_topicList( $selection, $selected='', $sortcol=1 )
{
global $_TABLES;
$retval = '';
$tmp = str_replace( 'DISTINCT ', '', $selection );
$select_set = explode( ',', $tmp );
$result = DB_query( "SELECT * FROM {$_TABLES['topics']}" . COM_getPermSQL( 'where', 0, 3 )
. " ORDER BY $select_set[$sortcol]" );
$nrows = DB_numRows( $result );
for( $i = 0; $i < $nrows; $i++ )
{
$A = DB_fetchArray( $result, true );
$retval .= '<option value="' . $A[0] . '"';
if( $A[0] == $selected )
{
$retval .= ' selected';
}
$retval .= '>' . stripslashes( $A[1] ) . '</option>' . LB;
}
return $retval;
}
Much the same as COM_topicList, except that
[code]
COM_getPermSQL()
Text Formatted Code
COM_getPermSQL( 'where', 0, 3 )
Text Formatted Code
<td align="right">{lang_owner}:</td>
<td>{owner_username}<input type="hidden" name="owner_id" value="{owner_id}"></td>
Text Formatted Code
<td align="right">{lang_owner}:</td>
<td>{owner_username}<input type="text" name="owner_id" value="{owner_id}"></td>
-- mystral-kk, "Every cloud has a silver lining."
9
6
Quote
All times are EST. The time is now 12:57 pm.
- 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