mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Issue #1298 Forum Query Fix and general cleanup. News Image Dimensions added where possible.
This commit is contained in:
@@ -203,9 +203,10 @@ if (ADMIN && isset($queryinfo) && is_array($queryinfo))
|
|||||||
{
|
{
|
||||||
$c = 1;
|
$c = 1;
|
||||||
$mySQLInfo = $sql->mySQLinfo;
|
$mySQLInfo = $sql->mySQLinfo;
|
||||||
echo "<div class='e-debug query-notice'><table class='fborder' style='width: 100%;'>
|
echo "<div class='e-debug query-notice'>
|
||||||
|
<table class='fborder table table-bordered table-striped' style='width: 100%;'>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption' style='width: 5%;'>ID</td><td class='fcaption' style='width: 95%;'>SQL Queries</td>\n</tr>\n";
|
<th class='fcaption' style='width: 5%;'>ID</th><th class='fcaption' style='width: 95%;'>SQL Queries</th>\n</tr>\n";
|
||||||
foreach ($queryinfo as $infovalue)
|
foreach ($queryinfo as $infovalue)
|
||||||
{
|
{
|
||||||
echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
|
echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
|
||||||
|
@@ -883,7 +883,7 @@ class e_layout
|
|||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
|
||||||
// $text = "<i class='icon-align-justify'></i> ";
|
// $text = "<i class='icon-align-justify'></i> ";
|
||||||
$text .= str_replace("_menu","",$row['name']);
|
$text = str_replace("_menu","",$row['name']);
|
||||||
|
|
||||||
// $layout = 'layout';
|
// $layout = 'layout';
|
||||||
// $area = 'area';
|
// $area = 'area';
|
||||||
@@ -986,6 +986,12 @@ class e_layout
|
|||||||
|
|
||||||
foreach($files as $file)
|
foreach($files as $file)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($file == 'e_menu.php')
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$valid_menu = false;
|
$valid_menu = false;
|
||||||
|
|
||||||
if (file_exists($file['path'].'/plugin.xml') || file_exists($file['path'].'/plugin.php'))
|
if (file_exists($file['path'].'/plugin.xml') || file_exists($file['path'].'/plugin.php'))
|
||||||
|
@@ -468,6 +468,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
$newsThumb = $tmp['file'];
|
$newsThumb = $tmp['file'];
|
||||||
|
|
||||||
$class = 'news-thumbnail-'.$tmp['count'];
|
$class = 'news-thumbnail-'.$tmp['count'];
|
||||||
|
$dimensions = null;
|
||||||
|
|
||||||
if(!$newsThumb && $parm != 'placeholder')
|
if(!$newsThumb && $parm != 'placeholder')
|
||||||
{
|
{
|
||||||
@@ -510,7 +511,11 @@ class news_shortcodes extends e_shortcode
|
|||||||
$_src = $src = ($newsThumb[0] == '{' || $parms[1] == 'placeholder') ? e107::getParser()->replaceConstants($newsThumb, 'abs') : e_IMAGE_ABS."newspost_images/".$newsThumb;
|
$_src = $src = ($newsThumb[0] == '{' || $parms[1] == 'placeholder') ? e107::getParser()->replaceConstants($newsThumb, 'abs') : e_IMAGE_ABS."newspost_images/".$newsThumb;
|
||||||
|
|
||||||
|
|
||||||
if($parms[2] || $parms[1] == 'placeholder') $src = e107::getParser()->thumbUrl($src, $parms[2]);
|
if($parms[2] || $parms[1] == 'placeholder')
|
||||||
|
{
|
||||||
|
$src = e107::getParser()->thumbUrl($src, $parms[2]);
|
||||||
|
$dimensions = e107::getParser()->thumbDimensions();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -523,15 +528,15 @@ class news_shortcodes extends e_shortcode
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tag':
|
case 'tag':
|
||||||
return "<img class='news_image ".$class."' src='".$src."' alt='' style='".$this->param['thumbnail']."' />";
|
return "<img class='news_image ".$class."' src='".$src."' alt='' style='".$this->param['thumbnail']."' {$dimensions} />";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'img':
|
case 'img':
|
||||||
return "<a href='".$_src."' rel='external image'><img class='news_image ".$class."' src='".$src."' alt='' style='".$this->param['thumbnail']."' /></a>";
|
return "<a href='".$_src."' rel='external image'><img class='news_image ".$class."' src='".$src."' alt='' style='".$this->param['thumbnail']."' {$dimensions} /></a>";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='news_image img-responsive img-rounded ".$class."' src='".$src."' alt='' style='".$this->param['thumbnail']."' /></a>";
|
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='news_image img-responsive img-rounded ".$class."' src='".$src."' alt='' style='".$this->param['thumbnail']."' {$dimensions} /></a>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -654,6 +659,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$class = "news_image news-image img-responsive img-rounded";
|
$class = "news_image news-image img-responsive img-rounded";
|
||||||
$class .= ' news-image-'.$tmp['count'];
|
$class .= ' news-image-'.$tmp['count'];
|
||||||
|
$dimensions = null;
|
||||||
|
|
||||||
|
|
||||||
if($tp->isVideo($srcPath))
|
if($tp->isVideo($srcPath))
|
||||||
@@ -667,7 +673,8 @@ class news_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
if(varset($parm['type']) == 'placeholder' || vartrue($parm['placeholder']))
|
if(varset($parm['type']) == 'placeholder' || vartrue($parm['placeholder']))
|
||||||
{
|
{
|
||||||
$src = $tp->thumbUrl(); // placeholder;
|
$src = $tp->thumbUrl(); // placeholder;
|
||||||
|
$dimensions = $tp->thumbDimensions();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -676,7 +683,8 @@ class news_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
elseif($srcPath[0] == '{' ) // Always resize. Use {SETIMAGE: w=x&y=x&crop=0} PRIOR to calling shortcode to change.
|
elseif($srcPath[0] == '{' ) // Always resize. Use {SETIMAGE: w=x&y=x&crop=0} PRIOR to calling shortcode to change.
|
||||||
{
|
{
|
||||||
$src = $tp->thumbUrl($srcPath);
|
$src = $tp->thumbUrl($srcPath);
|
||||||
|
$dimensions = $tp->thumbDimensions();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -709,12 +717,12 @@ class news_shortcodes extends e_shortcode
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'tag':
|
case 'tag':
|
||||||
return "<img class='{$class}' src='".$src."' alt='' style='".$this->param['thumbnail']."' />";
|
return "<img class='{$class}' src='".$src."' alt='' style='".$this->param['thumbnail']."' {$dimensions} />";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'url':
|
case 'url':
|
||||||
default:
|
default:
|
||||||
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='{$class}' src='".$src."' alt='' style='".$this->param['thumbnail']."' /></a>";
|
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='{$class}' src='".$src."' alt='' style='".$this->param['thumbnail']."' {$dimensions} /></a>";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -187,9 +187,9 @@ if (ADMIN && isset($queryinfo) && is_array($queryinfo))
|
|||||||
{
|
{
|
||||||
$c = 1;
|
$c = 1;
|
||||||
$mySQLInfo = $sql->mySQLinfo;
|
$mySQLInfo = $sql->mySQLinfo;
|
||||||
echo "<div class='e-debug query-notice'><table class='fborder' style='width: 100%;'>
|
echo "<div class='e-debug query-notice'><table class='fborder table table-striped table-bordered' style='width: 100%;'>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='fcaption' style='width: 5%;'>ID</td><td class='fcaption' style='width: 95%;'>SQL Queries</td>\n</tr>\n";
|
<th class='fcaption' style='width: 5%;'>ID</th><th class='fcaption' style='width: 95%;'>SQL Queries</th>\n</tr>\n";
|
||||||
foreach ($queryinfo as $infovalue)
|
foreach ($queryinfo as $infovalue)
|
||||||
{
|
{
|
||||||
echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
|
echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
|
||||||
|
@@ -1724,7 +1724,7 @@ class e107forum
|
|||||||
";
|
";
|
||||||
if ($sql->gen($qry))
|
if ($sql->gen($qry))
|
||||||
{
|
{
|
||||||
$row = $sql->fetch(MYSQL_ASSOC);
|
$row = $sql->fetch();
|
||||||
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user