mirror of
https://github.com/e107inc/e107.git
synced 2025-04-22 13:41:52 +02:00
Forum SEF Url fixes
This commit is contained in:
parent
989fc5ccd1
commit
0b96543a1a
e107_plugins/forum
@ -73,21 +73,23 @@ class forum_url // plugin-folder + '_url'
|
||||
);
|
||||
*/
|
||||
|
||||
$config['forum'] = array(
|
||||
'regex' => '^forum/([^\/]*)/?\??([^\/]*)?$',
|
||||
'sef' => 'forum/{forum_sef}',
|
||||
'redirect' => '{e_PLUGIN}forum/forum_viewforum.php?sef=$1&$2',
|
||||
'legacy' => '{e_PLUGIN}forum/forum_viewforum.php?id={forum_id}'
|
||||
);
|
||||
|
||||
$config['index'] = array(
|
||||
'regex' => '^forum/?$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'regex' => '^forum\/?$', // matched against url, and if true, redirected to 'redirect' below.
|
||||
'sef' => 'forum', // used by e107::url(); to create a url from the db table.
|
||||
'redirect' => '{e_PLUGIN}forum/forum.php', // file-path of what to load when the regex returns true.
|
||||
|
||||
);
|
||||
|
||||
|
||||
$config['forum'] = array(
|
||||
'regex' => '^forum\/([^\/]*)\/?\??([^\/]*)?$',
|
||||
'sef' => 'forum/{forum_sef}/',
|
||||
'redirect' => '{e_PLUGIN}forum/forum_viewforum.php?sef=$1&$2',
|
||||
'legacy' => '{e_PLUGIN}forum/forum_viewforum.php?id={forum_id}'
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ class forumStats
|
||||
{
|
||||
$text_3 .= "<tr>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||
<td style='width: 20%;' class='forumheader3'><a href='".e107::getUrl()->create('user/profile/view', $ma)."'>".$ma['user_name']."</a></td>
|
||||
<td style='width: 20%;' class='forumheader3'><a href='".e107::url('user/profile/view', $ma)."'>".$ma['user_name']."</a></td>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['user_forums']."</td>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['percentage']."%</td>
|
||||
<td style='width: 50%;' class='forumheader3'>".$this->showBar($ma['percentage'])."
|
||||
@ -399,7 +399,7 @@ class forumStats
|
||||
{
|
||||
$text_4 .= "<tr>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||
<td style='width: 20%;' class='forumheader3'><a href='".e107::getUrl()->create('user/profile/view', $ma)."'>".$ma['user_name']."</a></td>
|
||||
<td style='width: 20%;' class='forumheader3'><a href='".e107::url('user/profile/view', $ma)."'>".$ma['user_name']."</a></td>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['user_forums']."</td>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['percentage']."%</td>
|
||||
<td style='width: 50%; text-align: center;' class='forumheader3'>".$this->showBar($ma['percentage'])."</td>
|
||||
@ -430,7 +430,7 @@ class forumStats
|
||||
$text_5 .= "
|
||||
<tr>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||
<td style='width: 20%;' class='forumheader3'><a href='".e107::getUrl()->create('user/profile/view', $ma)."'>".$ma['user_name']."</a></td>
|
||||
<td style='width: 20%;' class='forumheader3'><a href='".e107::url('user/profile/view', $ma)."'>".$ma['user_name']."</a></td>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['user_forums']."</td>
|
||||
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['percentage']."%</td>
|
||||
<td style='width: 50%; text-align: center;' class='forumheader3'>".$this->showBar($ma['percentage'])."</td>
|
||||
@ -548,7 +548,7 @@ class forumStats
|
||||
|
||||
$text .= "<tr>
|
||||
<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>
|
||||
<td style='width:50%' class='forumheader3'><a href='".e107::getUrl()->create('user/profile/view', 'id='.$row['user_id'].'&name='.$row['user_name'])."'>{$row['user_name']}</a></td>
|
||||
<td style='width:50%' class='forumheader3'><a href='".e107::url('user/profile/view', 'id='.$row['user_id'].'&name='.$row['user_name'])."'>{$row['user_name']}</a></td>
|
||||
<td style='width:10%; text-align:center' class='forumheader3'>{$row['user_plugin_forum_posts']}</td>
|
||||
<td style='width:30%; text-align:center' class='forumheader3'>{$r}</td>
|
||||
</tr>";
|
||||
@ -619,21 +619,21 @@ class forumStats
|
||||
{
|
||||
if ($row['user_name'])
|
||||
{
|
||||
$POSTER = "<a href='".e107::getUrl()->create('user/profile/view', "name={$row['user_name']}&id={$row['thread_user']}")."'>{$row['user_name']}</a>";
|
||||
$POSTER = "<a href='".e107::url('user/profile/view', "name={$row['user_name']}&id={$row['thread_user']}")."'>{$row['user_name']}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$POSTER = $row['thread_user_anon'];
|
||||
}
|
||||
|
||||
$LINKTOTHREAD = e107::getUrl()->create('forum/thread/view', array('id' =>$row['thread_id'])); //$e107->url->getUrl('forum', 'thread', "func=view&id={$row['thread_id']}");
|
||||
$LINKTOFORUM = e107::getUrl()->create('forum/forum/view', array('id' => $row['thread_forum_id'])); //$e107->url->getUrl('forum', 'forum', "func=view&id={$row['thread_forum_id']}");
|
||||
$LINKTOTHREAD = e107::url('forum/thread/view', array('id' =>$row['thread_id'])); //$e107->url->getUrl('forum', 'thread', "func=view&id={$row['thread_id']}");
|
||||
$LINKTOFORUM = e107::url('forum/forum/view', array('id' => $row['thread_forum_id'])); //$e107->url->getUrl('forum', 'forum', "func=view&id={$row['thread_forum_id']}");
|
||||
|
||||
$lastpost_datestamp = $gen->convert_date($row['thread_lastpost'], 'forum');
|
||||
|
||||
if ($row['user_last'])
|
||||
{
|
||||
$LASTPOST = "<a href='".e107::getUrl()->create('user/profile/view', "name={$row['user_last']}&id={$row['thread_lastuser']}")."'>{$row['user_last']}</a><br />".$lastpost_datestamp;
|
||||
$LASTPOST = "<a href='".e107::url('user/profile/view', "name={$row['user_last']}&id={$row['thread_lastuser']}")."'>{$row['user_last']}</a><br />".$lastpost_datestamp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -255,14 +255,13 @@ else
|
||||
$pages = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($pages)
|
||||
{
|
||||
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
|
||||
{
|
||||
//if(!$page) $page = 1;
|
||||
$urlparms = $forumInfo;
|
||||
$urlparms['page'] = '[FROM]';
|
||||
$url = rawurlencode(e107::getUrl()->create('forum/forum/view', $urlparms));
|
||||
$url = e107::url('forum','forum',$forumInfo, array('query'=>array('p'=>'[FROM]')));
|
||||
$parms = "total={$pages}&type=page¤t={$page}&url=".$url."&caption=off";
|
||||
$fVars->THREADPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||
unset($urlparms);
|
||||
|
@ -525,7 +525,10 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
|
||||
// $ajaxInsert = 1;
|
||||
// echo "AJAX-INSERT=".$ajaxInsert ."(".$thread->pages." vs ".$thread->page.")";
|
||||
$frm = e107::getForm();
|
||||
|
||||
|
||||
$urlParms = array('f'=>'rp','id'=>$thread->threadInfo['thread_id'], 'post'=>$thread->threadInfo['thread_id']);
|
||||
$url = e107::url('forum','post', null, array('query'=>$urlParms));; // ."?f=rp&id=".$thread->threadInfo['thread_id']."&post=".$thread->threadInfo['thread_id'];
|
||||
|
||||
$tVars->QUICKREPLY = "
|
||||
<form action='" . $e107->url->create('forum/thread/reply', array('id' => $thread->threadId)) . "' method='post'>
|
||||
<div class='form-group'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user