-
AuthorPosts
-
August 4, 2008 at 9:54 pm #131783
Hello,
I’ve written an article with two images inside. Unfortunetly ‘mod_ja_catslwi’ displays in hot topic the second image of my article. Are there some specific criterias to do this and a way to configure correctly its work?
Thank you!!!
BrunoSherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 5, 2008 at 2:47 am #263823Hi winniekrapp !
Do you want to display first image ?August 5, 2008 at 7:30 am #263846Yes, thanks! How can i do this?
August 6, 2008 at 7:25 am #264040Help me, please! :confused:
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 6, 2008 at 9:52 am #264069Hi winniekrapp !
you can get first image following way below :
Open helper.php file in modulesmod_ja_catslwi folder , find following code section :
function replaceImage( &$row, $autoresize, $maxchars, $width = 0, $height = 0 ) {
global $database, $_MAMBOTS, $current_charset;
$image = "";
$regex = "/<img.+srcs*=s*"([^"]*)"[^>]*>/";
preg_match ($regex, $row->text, $matches);
$images = (count($matches)) ? $matches : array();
if (count($images)) $image = $images[1];if ($image) {
if ($autoresize && function_exists('imagecreatetruecolor')
&& ($image1 = modJaSLWI::processImage ( $image, $width, $height ))) {
$image = 'background:url('.JURI::base().$image1.') no-repeat;';
} else {
$image = 'background:url('.JURI::base().$image.') no-repeat;';
}
} else $image = '';$regex1 = "/<img.*/>/";
$row->introtext = preg_replace( $regex1, '', $row->introtext );
$row->introtext = trim($row->introtext);$row->introtext1 = strip_tags($row->introtext);
if ($maxchars && strlen ($row->introtext) > $maxchars) {
$row->introtext1 = substr ($row->introtext1, 0, $maxchars) . "...";
}
// clean up globals
return $image;
}
change to :
function replaceImage($row, $autoresize, $maxchars, $width = 0, $height = 0)
{
global $database, $_MAMBOTS, $current_charset;
$regex = "/<img.+srcs*=s*"([^"]*)"[^>]*>/";
$text = $row->introtext.$row->fulltext;
preg_match ($regex, $text, $matches);
$tmpAr = array(1);
$result = array();
while (count($tmpAr) && $matches[0]) {
$result = $matches;
preg_match ($regex, $text, $matches);
if (@$matches[0] == '') break;
$tmpAr = explode($matches[1],$matches[0]);
$text = $tmpAr[0];
}
$image = (count($result)) ? $result[1] : array();
$image = 'background:url('.JURI::base().$image.') no-repeat;';$regex1 = "/<img.*/>/";
$row->introtext = preg_replace( $regex1, '', $row->introtext );
$row->introtext = trim($row->introtext);$row->introtext1 = strip_tags($row->introtext);
if ($maxchars && strlen ($row->introtext) > $maxchars) {
$row->introtext1 = substr ($row->introtext1, 0, $maxchars) . "...";
}
return $image;}
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 6, 2008 at 10:03 am #264074You can downloas Patch for fix this issue below :
1 user says Thank You to Sherlock for this useful post
August 6, 2008 at 11:06 am #264091Thank You Hainn84 for your precious help.
Jason McDaniel FriendJason McDaniel
- Join date:
- September 2014
- Posts:
- 39
- Downloads:
- 0
- Uploads:
- 6
- Thanks:
- 4
January 11, 2009 at 10:27 pm #285979The autoresize isn’t working for me with the patch. All my images are original size and then cropped in the hot topic box.
-
AuthorPosts
This topic contains 8 replies, has 3 voices, and was last updated by Jason McDaniel 15 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum