Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / [SOLVED] select and use field images from database

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

× OLD Forum post could be checked here : forum.joomprod.com

[SOLVED] select and use field images from database

More
11 years 5 months ago - 11 years 5 months ago #1624 by zizi80
hi,
i want select and use the images column from my DB but the result is:

[{"index":1,"image":"image1.jpg","thumbnail":"image1_t.jpg","medium":"image1_m.jpg"},{"index":2,"image":"image2.jpg","thumbnail":"image2_t.jpg","medium":"image2_m.jpg"}]

how can I use the names of the images?
I do not understand how I can separate them.
please help me
Last edit: 11 years 5 months ago by loic.
The following user(s) said Thank You: adarr
More
11 years 5 months ago #1625 by wafa
can you specify your issue more clearly?
try to put a link to your website to understand what you want to do exactly?

thanks

tunisie annonce


AdsManager : 3.0.4
Joomla : Joomla! 3.4.1
Host : OVH
The following user(s) said Thank You: adarr
More
11 years 5 months ago #1626 by zizi80
Replied by zizi80 on topic select and use field images from database
i use the adsrating module i buyed this, but this have a bug, because i rename the ads, thi module don't load the images, why use ad_headline no real name, I would like to correct using the name that is saved in the DB
The following user(s) said Thank You: adarr
More
11 years 5 months ago #1627 by wafa
you can contact the support team for this module!
or try to attach the module + plugin, i'll see if i can modify the code

tunisie annonce


AdsManager : 3.0.4
Joomla : Joomla! 3.4.1
Host : OVH
The following user(s) said Thank You: adarr
More
11 years 5 months ago #1628 by zizi80
Replied by zizi80 on topic select and use field images from database
<?php



// This is the default output file

defined('_JEXEC') or die;

// Include the syndicate functions only once for Joomla 3.0



if(!defined('DS')){

define('DS',DIRECTORY_SEPARATOR);

}

//define('JPATH_BASE', dirname(__FILE__) );





jimport( 'joomla.filesystem.file' );

jimport('joomla.plugin.plugin');

jimport( 'joomla.filter.output' );

jimport('joomla.event.plugin');

jimport('joomla.filesystem.file');



$document = JFactory::getDocument();

$uri = JURI::root(true);

$document->addStyleSheet($uri.'/images/com_adsmanager/plugins/AdsManagerGTRatings/gtratings.css');



//Get Params



$showtitle = $params->get('gttitle');

$showimage = $params->get('gtimage');

$showCat = $params->get('gtcat');

$position = $params->get('gtposition');

$positionwidth = $params->get('widthposition');



if($position == '' || $position == 1){

$position = 'horizontal'; // position di default horizontal

}

else{

$position = 'vertical';

}

if($positionwidth == '' ){

$positionwidth = 200; // width position di default

}



echo "<div style='width:".$positionwidth. "px;' class='content".$position."'>";





foreach ($ratings as $item){

echo "<div class='".$position."'>";



//print_r($item);



$db =& JFactory::getDBO();

//Recupero dal Db le immagini

$sqlimg = "SELECT * FROM #__adsmanager_ads ";

$sqlimg .= "WHERE id = $item->id ORDER BY id DESC LIMIT 0,1";



$db->setQuery($sqlimg);

$db->query();



$rigads = $db->loadObject();

$imgads = $rigads->images;



$my_string = $imgads;

$countimg = substr_count($my_string,"thumbnail");

$index = substr($my_string, 10, 1);



$uri= JURI::root();

$linkTarget = JRoute::_( "index.php?option=com_adsmanager&view=details&id=".$item->id."&catid=".$item->catid);


if ($showtitle==1) echo "<a href='".$linkTarget."'>".JFilterOutput::stringURLSafe($item->ad_headline)."</a><br>";

if ($countimg!=0){

$assolutepath = JPATH_BASE."/images/com_adsmanager/ads/".JFilterOutput::stringURLSafe($item->ad_headline)."_".$item->id."_".$index."_m.jpg";

$filename = $uri."images/com_adsmanager/ads/".JFilterOutput::stringURLSafe($item->ad_headline)."_".$item->id."_".$index."_m.jpg";

$imageExists = JFile::exists($assolutepath);



if ($imageExists){

echo '<a href="index.php?option=com_adsmanager&view=details&id='.$item->id.'&catid='.$item->catid.'"><img src="'.$filename.'"></a>';

} else {

echo '<a href="index.php?option=com_adsmanager&view=details&id='.$item->id.'&catid='.$item->catid.'"><img src="components/com_adsmanager/images/nopic.gif" alt="noimage" style="height: 100px; width:133px;"></a>';

}

} else { echo '<a href="index.php?option=com_adsmanager&view=details&id='.$item->id.'&catid='.$item->catid.'"><img src="components/com_adsmanager/images/nopic.gif" alt="noimage" style="height: 100px; width:133px;"></a>';



}

if ($showCat==1){
echo "<br><span style='font-size:11px; color:#999;'>Categoria: <b>".$item->parent."</b> ".$item->cat."</span><br>";
//echo "<br>";
} else echo "<br>";





/*echo "<br>";

echo "id:".$item->content_id."<br>";

echo "somma:".$item->rating_sum."<br>";

echo "voti:".$item->rating_count."<br>";

//echo $xid;*/

echo modGTRatingsHelper::getStars( $item->content_id, $item->rating_sum, $item->rating_count, $xid );

echo "</div>";



//echo "<div style='clear:both'><div>";



}



?>



</div>
The following user(s) said Thank You: adarr
More
11 years 5 months ago #1629 by zizi80
Replied by zizi80 on topic select and use field images from database
$assolutepath = JPATH_BASE."/images/com_adsmanager/ads/".JFilterOutput::stringURLSafe($item->ad_headline)."_".$item->id."_".$index."_m.jpg";

$filename = $uri."images/com_adsmanager/ads/".JFilterOutput::stringURLSafe($item->ad_headline)."_".$item->id."_".$index."_m.jpg";


this is the line
The following user(s) said Thank You: adarr
Moderators: perry
Time to create page: 0.148 seconds
Powered by Kunena Forum