mirror of
https://github.com/e107inc/e107.git
synced 2025-04-18 03:31:54 +02:00
Query optimization.
This commit is contained in:
parent
29ddbe09e8
commit
d85bc31932
@ -890,7 +890,7 @@ class e_user_model extends e_admin_model
|
||||
*/
|
||||
public function load($user_id = 0, $force = false)
|
||||
{
|
||||
$qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended as ue ON u.user_id=ue.user_extended_id WHERE user_id={ID}";
|
||||
$qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended as ue ON u.user_id=ue.user_extended_id WHERE u.user_id={ID}";
|
||||
$this->setParam('db_query', $qry);
|
||||
parent::load($user_id, $force);
|
||||
if ($this->getId())
|
||||
@ -1834,7 +1834,7 @@ class e_user extends e_user_model
|
||||
|
||||
final protected function _load($user_id)
|
||||
{
|
||||
$qry = 'SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended as ue ON u.user_id=ue.user_extended_id WHERE user_id='.intval($user_id);
|
||||
$qry = 'SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended as ue ON u.user_id=ue.user_extended_id WHERE u.user_id='.intval($user_id);
|
||||
if(e107::getDb()->gen($qry))
|
||||
{
|
||||
return e107::getDb()->fetch();
|
||||
|
@ -540,6 +540,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
$text .= "<li role='presentation' class='divider'> </li>";
|
||||
$type = ($this->postInfo['thread_start']) ? 'thread' : 'Post';
|
||||
|
||||
// print_a($this->postInfo);
|
||||
|
||||
if ((USER && $this->postInfo['post_user'] != USERID && $this->thread->threadInfo['thread_active']))
|
||||
{
|
||||
|
||||
@ -550,7 +552,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
// only show delete button when post is not the initial post of the topic
|
||||
if(!$this->forum->threadDetermineInitialPost($this->postInfo['post_id']))
|
||||
// if(!$this->forum->threadDetermineInitialPost($this->postInfo['post_id']))
|
||||
if(empty($this->postInfo['thread_start']))
|
||||
{
|
||||
$text .= "<li class='text-right'><a href='".e_REQUEST_URI."' data-forum-action='deletepost' data-forum-post='".$this->postInfo['post_id']."'>".LAN_DELETE." ".$tp->toGlyph('trash')."</a></li>";
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user