Free Press Release Submission




MB Publishing Webmaster Resource ::
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin 


Image Restriction

 
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Nuke Blocks
View previous topic :: View next topic  
Author Message
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 412

PostPosted: Tue Sep 28, 2004 10:13 am    Post subject: Image Restriction Reply with quote

See this block, how can we restrict the size of the image shown? To say 100 pixels?



Code:

if (eregi("block-Amazon.php",$PHP_SELF))
{
    Header("Location: index.php");
    die();
}

global $temp, $prefix, $db, $currentlang, $lang, $language, $newlang;

# Get Settings
   $sql = "SELECT AMZVer, AMZModule_Name, AMZ_id, cache_maxtime, AMZMore, AMZSingle, AMZQuickAdd, AMZShowReview, AMZShowSimilar, AMZLocale, AMZReviewMod, ImageType, AMZ_Popular, AMZBuyBox, AMZShowXML FROM ".$prefix."_amazon_cfg";
    $result = $db->sql_query($sql);
    $row = $db->sql_fetchrow($result);
   $AMZVer   = $row[AMZVer];       
   $AMZModule_Name = $row[AMZModule_Name];
   $amazon_id = $row[AMZ_id];       
   $amazon_xml_cache_maxtime = $row[cache_maxtime];
   $AMZMore = $row[AMZMore];       
   $AMZSingle = $row[AMZSingle];    
   $AMZQuickAdd = $row[AMZQuickAdd];    
   $AMZShowReview = $row[AMZShowReview];
   $AMZShowSimilar = $row[AMZShowSimilar];
   $AMZLocale = $row[AMZLocale];    
   $AMZReviewMod = $row[AMZReviewMod]; 
   $AMZImgType = $row[ImageType];    
   $AMZ_Popular = $row[AMZ_Popular];    
   $AMZBuyBox = $row[AMZBuyBox];    
   $AMZShowXML = $row[AMZShowXML];    

require_once("includes/NukeAmazon/functions.php");

if (isset($newlang))
{
   include("modules/Amazon/language/lang-$newlang.php");
   $language = $newlang;
}
elseif (isset($lang))
{
    include("modules/Amazon/language/lang-$lang.php");
    $language = $lang;
}
else
{
   include("modules/Amazon/language/lang-$language.php");
}

   $Asin = GetAsin('');

   $amazon = amazon_search('AsinSearch', $Asin, '', 'lite', '');

   if(isset($amazon->errorMsg))
   {
   # Error with Requested Data, use the default ASIN.
      $SQL = "SELECT default_asin FROM ".$prefix."_amazon_cfg";
      $result = sql_query($SQL, $dbi);
      list($Asin) = sql_fetch_row($result, $dbi);
      $amazon = amazon_search('AsinSearch', $Asin, '', 'lite', '');
   }

    sql_query("update ".$prefix."_amazon_items set imp=imp+1 where asin='$Asin'", $dbi);   
   
   foreach ($amazon->records as $ind => $arr) {
   
# Extract fields of interest but first clear from previews pass.
      $ProductCatalog        = $arr['catalog'];
      if( is_array($arr['artist']))
      {
         $ArtistCount = count($arr['artist']);
         $Artist = "";
         $i = 0;
         while ($ArtistCount > $i)
         {
            if ($i > 0)
            {
               $Artist .= ", ";
            }
            $Artist .= "<a href=\"modules.php?name=$AMZModule_Name&op=ArtistSearch&keyword=".urlencode($arr['artist'][$i])."&mode=".strtolower($ProductCatalog)."\">".$arr['artist'][$i]."</a>";
            $i++;
         }
      }
      $ProductName           = $arr['productname'];
      $OurPrice              = $arr['ourprice'];
      if ($OurPrice == "")
      {
         $OurPrice = $arr['listprice'];
      }
      $ListPrice           = $arr['listprice'];
      $Savings             = AMZsavings($ListPrice,$OurPrice);

      if (strtolower($OurPrice) == "too low to display")
      {
         $OurPrice = ""._AMZTOOLOW."";
      }
   }

   $ImageUrl = AMZIS($Asin, 'M');

   if ($Savings[1] > 0 && $AMZImgType != "NO")
   {
      if ($Savings[1] > 9)
      {
         $ImageUrl = str_replace (".01.", ".01._PE".$Savings[1]."_".$AMZImgType."_SC", $ImageUrl);
      }
      else
      {
         $ImageUrl = str_replace (".01.", ".01._PE0".$Savings[1]."_".$AMZImgType."_SC", $ImageUrl);
      }
      $ImageUrl = str_replace (".jpg", "_.jpg", $ImageUrl);
   }


   $LinkURL = "modules.php?name=$AMZModule_Name&asin=$Asin";
   $LinkStartStr = "<a href=\"$LinkURL\">";

   $content = "<table width=\"129\"><tr width=\"129\"><td width=\"129\"><br><center>\n";
   if ($Artist)
   {
      $content .= "<b>" . $Artist . "</b><br><br>\n";
   }
   $content .=  $LinkStartStr;
   $content .=  "<img src=\"" . $ImageUrl . "\" border =\"0\" alt=\"$ProductName\">\n";
   $content .=  "</a></center>";
   $content .=  "</td>\n";
   $content .=  "<tr width=\"129\">";
   $content .=  "<td width=\"129\"><center>\n";
   $content .=  $LinkStartStr;
   $content .=  "<b>$ProductName</b>";
   $content .=  "</a>";
   $content .=  "<br>";
   if ($OurPrice)
   {
      $content .=  "<b>"._AMZBLKPRICE.":</b> $OurPrice</b><br>\n";
   }
   if ($AMZBuyBox)
   {
      $content .= AMZBuyBox($Asin);
   }

   $content .=  "</center></td>";
   $content .=  "</tr>";
   $content .=  "</table>";
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Humpa
Site Admin
Site Admin


Joined: Feb 05, 2004
Posts: 23

PostPosted: Tue Sep 28, 2004 4:14 pm    Post subject: Reply with quote

Just change this one line:
Code:
$content .=  "<img src=\"" . $ImageUrl . "\" border =\"0\" alt=\"$ProductName\">\n";

To this:
Code:
$content .=  "<img src=\"" . $ImageUrl . "\" border =\"0\" alt=\"$ProductName\" width=\"100\">\n";
Back to top
View users profile Send private message Visit posters website
Colocation
Site Admin
Site Admin


Joined: Jan 07, 2004
Posts: 412

PostPosted: Wed Sep 29, 2004 9:16 am    Post subject: Sweet Reply with quote

Ah, that's sweet!

Thanks!

icon_biggrin.gif
Back to top
View users profile Send private message Visit posters website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    MB Publishing Webmaster Resource Forum Index -> Nuke Blocks All times are GMT + 1 Hour
Page 1 of 1

 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Home | News Feeds | Release Archive | Web Marketing | Weight Loss | Publish Your Links | Press Release Topics | Free Downloads | Press FAQs | AvantGO | Amazon Store
Webmaster Forums | Search Releases | Press Topics | Feedback | Submit Press Release | Webmaster Surveys | Recommend | Top | Account | PM | Prweb | Free Link Submission | Add Downloads | New Media | Audio School | TOS

The comments are property of their posters, all the rest 2004 - 2008 by MB
Audana Ltd
You can syndicate our news using the file backend.php
Web site engine's code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 1.238 Seconds. -