php help recipes .php

Σε αυτή την περιοχή μπορείτε να βρείτε ή να αναζητήσετε πληροφορίες σχετικές με την PHP

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
Άβαταρ μέλους
Nektarios333
Δημοσιεύσεις: 136
Εγγραφή: 26 Μαρ 2007 17:58
Επικοινωνία:

php help recipes .php

Δημοσίευση από Nektarios333 » 03 Σεπ 2009 00:58

Καλησπέρα έχω μια σελίδα με συνταγές μαγειρικής στην σελίδα των συνταγών εμφανίζεται
η φωτογραφία της συνταγής εγώ θέλω όταν δεν υπάρχει εικόνα στην συνταγή να μην εμφανίζεται καθόλου η εικόνα που έχει οριστεί να εμφανίζεται όταν δεν υπάρχει εικόνα στην συνταγή ;πως θα το καταφέρω αυτό;

O κώδικας της σελίδας recipes.php

Κώδικας: Επιλογή όλων

<?php
&#125;
else
&#123;
include&#40;"header.php"&#41;;
&#125;
////////////////// category menu ////////////////////////////

if &#40;$_REQUEST&#91;action&#93; == "sub_category_list"&#41;
&#123;
echo "<strong>$lang_category_list</strong><br /><br />";
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 $result_sub = mysql_query&#40;"SELECT * FROM ".$lang."_recipe_category_2 where category_main = ".$_REQUEST&#91;"recipe_category_1"&#93;." order by category_id"&#41;;
  if&#40;!$result_sub&#41; die&#40;mysql_error&#40;&#41;&#41;;
 $total_number = mysql_num_rows&#40;$result_sub&#41;;        
 if &#40;$total_number == 0&#41;
  &#123;
   echo "<br /><br /><center>$lang_no_results<br /><br /><br /><a href=\"javascript&#58;history.back&#40;1&#41;\">$lang_back</a></center>";
  &#125;else
  &#123;
  &#125;
while&#40;$category_sub = mysql_fetch_object&#40;$result_sub&#41;&#41; &#123;  

echo "<img src=\"images/arrowred.png\" alt=\"$category_sub->category_name\" width=\"7\" height=\"5\" /> <strong><a href=\"recipe.php?action=search_results&amp;recipe_category_1=$_REQUEST&#91;recipe_category_1&#93;&amp;recipe_category_2=$category_sub->category_id\">$category_sub->category_name</a></strong><br />";

&#125;
&#125;
////////////////////////////////////////////////////////////////////////////////  
////////////////////////////////////////////////////////////////////////////////   
////////////////// category list ////////////////////////////

 
if &#40;$_REQUEST&#91;action&#93; == "mass_category_list" OR $_REQUEST&#91;action&#93; == ""&#41;
&#123;
echo "<strong>$lang_category_list</strong><br /><br />";
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 $result = mysql_query&#40;"SELECT * FROM ".$lang."_recipe_category order by category_id"&#41;;
  if&#40;!$result&#41; die&#40;mysql_error&#40;&#41;&#41;;
 $total_number = mysql_num_rows&#40;$result&#41;;        
 if &#40;$total_number == 0&#41;
  &#123;
   echo "<br /><br /><center>$lang_no_results<br /><br /><br /><a href=\"javascript&#58;history.back&#40;1&#41;\">$lang_back</a></center>";
  &#125;else
  &#123;
  &#125;
while&#40;$category_1 = mysql_fetch_object&#40;$result&#41;&#41; &#123;  

echo "<img src=\"images/arrowred.png\" alt=\"$category_1->category_name\" width=\"7\" height=\"5\" /> <strong><a href=\"recipe.php?action=search_results&amp;recipe_category_1=$category_1->category_id\">$category_1->category_name</a></strong><br />";

$result2 = mysql_query&#40;"SELECT * FROM ".$lang."_recipe_category_2 where category_main = '$category_1->category_id'"&#41;;
  if&#40;!$result2&#41; die&#40;mysql_error&#40;&#41;&#41;;
 
while&#40;$category_2 = mysql_fetch_object&#40;$result2&#41;&#41; &#123;  
echo "&nbsp;&nbsp;&nbsp;&nbsp; <a href=\"recipe.php?action=search_results&amp;recipe_category_1=$category_1->category_id&amp;recipe_category_2=$category_2->category_id\">$category_2->category_name</a><br />";
&#125;
&#125;
&#125;
////////////////////////////////////////////////////////////////////////////////  
if &#40;$_REQUEST&#91;action&#93; == "list" OR $_REQUEST&#91;action&#93; == "search_results"&#41;
&#123;

if &#40;$_REQUEST&#91;action&#93; == "list"&#41;
&#123;
echo "<strong>$lang_recipe_list</strong><br /><br />";
&#125;else
&#123;
echo "<strong>$lang_search_results</strong><br /><br />";
&#125;



if &#40;$_REQUEST&#91;recommended&#93; == "show"&#41;
&#123;
$recommended_show = " AND recipe_futured = 'yes'";
&#125;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$totals = mysql_query&#40;"SELECT * FROM ".$lang."_recipe where recipe_title LIKE '%$_REQUEST&#91;recipe_title&#93;%' AND recipe_category LIKE '%$_REQUEST&#91;recipe_category_1&#93;%' AND recipe_category_2 LIKE '%$_REQUEST&#91;recipe_category_2&#93;%' AND recipe_category_3 LIKE '%$_REQUEST&#91;recipe_category_3&#93;%' AND recipe_category_4 LIKE '%$_REQUEST&#91;recipe_category_4&#93;%' AND recipe_description LIKE '%$_REQUEST&#91;description&#93;%' AND recipe_id LIKE '%$_REQUEST&#91;recipe_id&#93;%' ".$recommended_show." AND recipe_active = 'yes'"&#41;;
  if&#40;!$totals&#41; die&#40;mysql_error&#40;&#41;&#41;;
   
$total_entries                  = mysql_fetch_object&#40;$totals&#41;;
$total_items      = mysql_num_rows&#40;$totals&#41;;
$limit            = $_GET&#91;'limit'&#93;;
$type             = $_GET&#91;'type'&#93;;
$page             = $_GET&#91;'page'&#93;;


if&#40;&#40;!$limit&#41;  || &#40;is_numeric&#40;$limit&#41; == false&#41; || &#40;$limit < 10&#41; || &#40;$limit > 50&#41;&#41; &#123;
     $limit = 5; //default
&#125;

if&#40;&#40;!$page&#41; || &#40;is_numeric&#40;$page&#41; == false&#41; || &#40;$page < 0&#41; || &#40;$page > $total_items&#41;&#41; &#123;
      $page = 1; //default
&#125;

$total_pages     = ceil&#40;$total_items / $limit&#41;;
$set_limit          = $page * $limit - &#40;$limit&#41;;

 
$result = mysql_query&#40;"SELECT * FROM ".$lang."_recipe where recipe_title LIKE '%$_REQUEST&#91;recipe_title&#93;%' AND recipe_category LIKE '%$_REQUEST&#91;recipe_category_1&#93;%' AND recipe_category_2 LIKE '%$_REQUEST&#91;recipe_category_2&#93;%' AND recipe_category_3 LIKE '%$_REQUEST&#91;recipe_category_3&#93;%' AND recipe_category_4 LIKE '%$_REQUEST&#91;recipe_category_4&#93;%' AND recipe_description LIKE '%$_REQUEST&#91;description&#93;%' AND recipe_id LIKE '%$_REQUEST&#91;recipe_id&#93;%' AND recipe_active = 'yes' order by recipe_id LIMIT $set_limit, $limit"&#41;;
  if&#40;!$result&#41; die&#40;mysql_error&#40;&#41;&#41;;
 $total_number = mysql_num_rows&#40;$totals&#41;;        
 if &#40;$total_number == 0&#41;
  &#123;
   echo "<br /><br /><center>$lang_no_search_results<br /><br /><a href=\"javascript&#58;history.back&#40;1&#41;\">$lang_back</a></center>";
  &#125;else
  &#123;
   echo " <center>$lang_results $total_number $lang_results_2</center><br />";
  &#125;
while&#40;$recipe = mysql_fetch_object&#40;$result&#41;&#41; &#123;  
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////// nomos //////
$sql_category_1 = "SELECT category_name FROM ".$lang."_recipe_category WHERE category_id = '$recipe->recipe_category'";
$result_category_1 = mysql_query&#40;$sql_category_1&#41;; 
$recipe_category_1 = mysql_fetch_object&#40;$result_category_1&#41;;
//////// dimos ///////
$sql_category_2 = "SELECT category_name FROM ".$lang."_recipe_category_2 WHERE category_id = '$recipe->recipe_category_2'";
$result_category_2 = mysql_query&#40;$sql_category_2&#41;; 
$recipe_category_2 = mysql_fetch_object&#40;$result_category_2&#41;;
/////// tupos ///////
$sql_category_3 = "SELECT category_name FROM ".$lang."_recipe_category_3 WHERE category_id = '$recipe->recipe_category_3'";
$result_category_3 = mysql_query&#40;$sql_category_3&#41;; 
$recipe_category_3 = mysql_fetch_object&#40;$result_category_3&#41;;
///////diathesimo ///
$sql_category_4 = "SELECT category_name FROM ".$lang."_recipe_category_4 WHERE category_id = '$recipe->recipe_category_4'";
$result_category_4 = mysql_query&#40;$sql_category_4&#41;; 
$recipe_category_4 = mysql_fetch_object&#40;$result_category_4&#41;;
if &#40;$recipe->recipe_photo_1 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_1";
&#125;else if &#40;$recipe->recipe_photo_2 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_2";
&#125;else if &#40;$recipe->recipe_photo_3 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_3";
&#125;else if &#40;$recipe->recipe_photo_4 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_4";
&#125;else if &#40;$recipe->recipe_photo_5 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_5";
&#125;else
&#123;
$photo = "no_photo.jpg";
&#125;

echo "


<table width=\"90%\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\" align=\"center\">
  <tr>
    <td colspan=\"3\" align=\"left\" valign=\"middle\" class=\"recipe_top\" height=\"20\">$recipe_category_1->category_name &#58; $recipe_category_2->category_name $recipe->recipe_title &#40;# $recipe->recipe_id&#41;
	
	</td>
  </tr>
  <tr>
    <td width=\"100\" rowspan=\"2\" align=\"center\" valign=\"top\">
	<a href= \"recipe.php?action=view_listing&amp;recipe_id=$recipe->recipe_id&amp;recipe_category_1=$recipe->recipe_category\">
	<img src=\"recipe_objects/recipe_photos/thumbnails/$photo\" width=\"100\" height=\"75\" border=\"1\" /></a>
	</td>
    <td align=\"left\" valign=\"top\">
".preg_replace&#40;"&#91;\n&#93;", "<br />", substr&#40;$recipe->recipe_description,0,200&#41;&#41;."...

	</td>
    <td align=\"left\" valign=\"top\">
$recipe_category_3->category_name
<br />
$recipe_category_4->category_name	</td>
  </tr>
  <tr>
    <td colspan=\"2\" align=\"right\" valign=\"bottom\">
	<a href= \"recipe.php?action=view_listing&amp;recipe_id=$recipe->recipe_id&amp;recipe_category_1=$recipe->recipe_category\">$lang_click_for_more</a>
	</td>
  </tr>
  <tr>
    <td colspan=\"3\" align=\"left\" valign=\"middle\" class=\"recipe_bottom\" height=\"5\"></td>
  </tr>
</table>

";
&#125;
 /////////// for paginaion 2 //////////////////
echo "<center>";
 
$prev_page = $page - 1;

if&#40;$prev_page >= 1&#41; &#123;
  echo "<b>&lt;&lt;</b> <a href=\"recipe.php?action=$action&amp;recommended=$recommended&amp;recipe_category_1=".$_REQUEST&#91;recipe_category_1&#93;."&amp;recipe_category_2=".$_REQUEST&#91;recipe_category_2&#93;."&amp;recipe_category_3=".$_REQUEST&#91;recipe_category_3&#93;."&amp;recipe_category_4=".$_REQUEST&#91;recipe_category_4&#93;."&amp;recipe_id=".$_REQUEST&#91;recipe_id&#93;."&amp;page=$prev_page\"><b>$lang_previous</b></a>";
&#125;

//Display middle pages&#58; **EDIT LINK PATH**

for&#40;$total_entries = 1; $total_entries <= $total_pages; $total_entries++&#41;
&#123;
   if&#40;$total_entries == $page&#41; &#123;
      echo&#40;"<b> $total_entries</b> | "&#41;; //no link
     &#125; else &#123;
  echo "  <a href=\"recipe.php?action=$action&amp;recommended=$recommended&amp;recipe_category_1=".$_REQUEST&#91;recipe_category_1&#93;."&amp;recipe_category_2=".$_REQUEST&#91;recipe_category_2&#93;."&amp;recipe_category_3=".$_REQUEST&#91;recipe_category_3&#93;."&amp;recipe_category_4=".$_REQUEST&#91;recipe_category_4&#93;."&amp;recipe_id=".$_REQUEST&#91;recipe_id&#93;."&amp;page=$total_entries\"> $total_entries </a> | ";
     &#125;
&#125;

//next page&#58; **EDIT THIS LINK PATH**

$next_page = $page + 1;
if&#40;$next_page <= $total_pages&#41; &#123;
   echo "<a href=\"recipe.php?action=$action&amp;recommended=$recommended&amp;recipe_category_1=".$_REQUEST&#91;recipe_category_1&#93;."&amp;recipe_category_2=".$_REQUEST&#91;recipe_category_2&#93;."&amp;recipe_category_3=".$_REQUEST&#91;recipe_category_3&#93;."&amp;recipe_category_4=".$_REQUEST&#91;recipe_category_4&#93;."&amp;recipe_id=".$_REQUEST&#91;recipe_id&#93;."&amp;page=$next_page\"><b>$lang_next</b></a> &gt; &gt;";
&#125;

 /////////// for paginaion 2 //////////////////
&#125;
if &#40;$_REQUEST&#91;action&#93; == "_simple_list"&#41;
&#123;
&#125;
///////////////////////////////////emfanisi egrafis///////////////////////////////////////////////
 
if &#40;$_REQUEST&#91;action&#93; == "view_listing"&#41;
&#123; 
$sql = "SELECT * FROM ".$lang."_recipe where recipe_id = '$_REQUEST&#91;recipe_id&#93;' AND recipe_active = 'yes'";
$result = mysql_query&#40;$sql&#41;; 
$recipe = mysql_fetch_object&#40;$result&#41;;
 
 ?>
 

<table width="100%" border="0" cellspacing="3" cellpadding="3">
  <tr> 
    <td width="100%" align="right" valign="middle"> 
      <?php
if &#40;$print != "yes"&#41;
&#123;
?>
      <a href="index.php"><img src="images/home.jpg" alt="<?php echo "$lang_home"; ?>" width="20" height="20" hspace="10" border="0" /></a><a href="<?php echo "user_recipe.php?action=add_love&amp;recipe_id=$_REQUEST&#91;recipe_id&#93;"; ?>"><img src="/images/favorites.jpg" alt="" width="20" height="20" hspace="10" border="0" /></a><a href="recipe.php?action=search"><img src="images/search.jpg" alt="<?php echo "$lang_search"; ?>" width="20" height="20" hspace="10" border="0" /></a><a href="recipe.php?action=<?php echo "$_REQUEST&#91;action&#93;"; ?>&amp;recipe_id=<?php echo "$_REQUEST&#91;recipe_id&#93;"; ?>&amp;photo=<?php echo "$photo"; ?>&amp;print=yes" target="_blank"><img src="images/print.jpg" alt="<?php echo "$lang_print_view"; ?>" width="20" height="20" hspace="10" border="0" /></a><a href="page.php?page=recommended"><img src="images/email_send.jpg" alt="<?php echo "$lang_send_maiil_for_recipe"; ?>" width="20" height="20" hspace="10" border="0" /></a> 
      <?php
&#125;
?>
    </td>
  </tr>
  <tr> 
    <td height="20" align="left" valign="middle" class="recipe_top"> <strong> 
      <?php
	echo "$recipe->recipe_title";
	?>
      </strong></td>
  </tr>
  <tr> 
    <td align="left" valign="middle"><table width="100%" border="0" cellspacing="3" cellpadding="0">
        <tr> 
          <td colspan="2" align="left" valign="middle"> 
            <?php
	$result_1 = mysql_query &#40;"SELECT category_name from ".$lang."_recipe_category where category_id = '$recipe->recipe_category'"&#41;;
	$recipe_1 = mysql_fetch_object&#40;$result_1&#41;;
 	echo "$recipe_1->category_name";
	?>
            &#58; 
            <?php
	$result_2 = mysql_query &#40;"SELECT category_name from ".$lang."_recipe_category_2 where category_id = '$recipe->recipe_category_2'"&#41;;
	$recipe_2 = mysql_fetch_object&#40;$result_2&#41;;
	echo "$recipe_2->category_name";
	?>
          </td>
        </tr>
        <tr> 
          <td align="left" valign="middle">Βαθμός δυσκολίας&#58;</td>
          <td align="left" valign="middle"><img src="images/<?php echo "$recipe->recipe_extra_3"; ?>.jpg" alt="" /></td>
        </tr>
        <tr> 
          <td align="left" valign="middle">Προέλευση&#58;</td>
          <td align="left" valign="middle"><?php echo "$recipe->recipe_extra_4"; ?></td>
        </tr>
        <tr> 
          <td align="left" valign="middle">Προστέθηκε από&#58;</td>
          <td align="left" valign="middle"><?php echo "$recipe->recipe_extra_5"; ?></td>
        </tr>
        <tr> 
          <td align="left" valign="middle"><a href="recipe.php?action=vote&amp;recipe_id=<?php echo "$_REQUEST&#91;recipe_id&#93;"; ?>">Δώσε 
            θετική ψήφο στην συνταγή </a></td>
          <td align="left" valign="middle">Ψήφοι&#58;<?php echo "$recipe->recipe_votes"; ?></td>
        </tr>
        <tr> </tr>
        <td height="0" colspan="2" align="left" valign="middle" class="recipe_top"> 
          <table width="100%" border="0" cellpadding="3" cellspacing="3" dwcopytype="CopyTableCell">
            <tr> 
              <td height="26" align="left" valign="top"><strong>H <?php echo "$recipe->recipe_extra_5"; ?> 
                γράφει..</strong> </td>
            </tr>
          </table>
          <?php
 echo  preg_replace&#40;"&#91;\n&#93;", "<br />", $recipe->recipe_extra_6&#41;;  
	?>
        </td>
        </tr>
        <tr> 
          <td height="20" colspan="2" align="left" valign="middle" class="recipe_top"><strong>Υλικά</strong>&#58; 
          </td>
        </tr>
        <tr> 
          <td align="left" valign="middle" height="5"></td>
        </tr>
        <tr> 
          <td align="left" valign="top" class="ylika"> 
            <?php
echo "<img src=\"images/arrows.jpg\" alt=\"\" width=\"11\" height=\"11\" /> ";

echo  preg_replace&#40;"&#91;,&#93;", "<br /><img src=\"images/arrows.jpg\" alt=\"\" width=\"11\" height=\"11\" /> ", "$recipe->recipe_extra_1"&#41;;  

echo "";
?>
          </td>
          <td align="center" valign="middle"> 
            <?




//////////
$recipe_sql_2 = "SELECT * FROM ".$lang."_recipe_category where category_id = '$recipe->recipe_category'";
$recipe_result_2 = mysql_query&#40;$recipe_sql_2&#41;; 
$recipe_content_2 = mysql_fetch_object&#40;$recipe_result_2&#41;;
/////////
$recipe_sql_3 = "SELECT * FROM ".$lang."_recipe_category_2 where category_id = '$recipe->recipe_category_2'";
$recipe_result_3 = mysql_query&#40;$recipe_sql_3&#41;; 
$recipe_content_3 = mysql_fetch_object&#40;$recipe_result_3&#41;;
//////////


if &#40;$recipe->recipe_photo_1 != ""&#41;
&#123;
$photo_0_recipe = "recipe_objects/recipe_photos/$recipe->recipe_photo_1";
&#125;else
&#123;
if &#40;$recipe_content_2->category_photo != ""&#41;
&#123;
$photo_0_recipe= "recipe_objects/categories_photos/$recipe_content_2->category_photo";
&#125;else
&#123;
if &#40;$recipe_content_3->category_photo != ""&#41;
&#123;
$photo_0_recipe = "recipe_objects/categories_photos/$recipe_content_2->category_photo";
&#125;else
&#123;
$photo_0_recipe = "recipe_objects/categories_photos/no_photo2.jpg";

&#125;
&#125;

&#125;


 
echo "<img src=\"$photo_0_recipe\" width=\"200\" />";
?>
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="20" align="left" valign="middle" class="recipe_top"><strong>Εκτέλεση&#58;</strong></td>
  </tr>
  <tr> 
    <td align="left" valign="middle" class="listing"> 
      <?php
 echo  preg_replace&#40;"&#91;\n&#93;", "<br />", $recipe->recipe_description&#41;;  
	?>
    </td>
  </tr>
  <tr> 
    <td align="left" valign="middle" class="recipe_top"><strong>Σχόλια&#58;</strong></td>
  </tr>
  <tr> 
    <td align="left" valign="middle" class="listing"> 
      <?

$sqlcom = mysql_query&#40;"SELECT * FROM ".$lang."_comments where comments_news_id = '$_REQUEST&#91;recipe_id&#93;' order by comments_date"&#41;; 
//$com = mysql_fetch_object&#40;$sqlcom&#41;;

 if &#40;mysql_num_rows&#40;$sqlcom&#41; == "0"&#41;
 &#123;
echo "Δεν υπάρχουν καταχωρημένα σχόλια αυτή τη στιγμή";
&#125;else
&#123;

while&#40;$comments = mysql_fetch_object&#40;$sqlcom&#41;&#41; 
&#123; 
echo "<strong>$comments->comments_user</strong><br />
$comments->comments_content
<hr class=\"hr\" />";
&#125;
&#125;
?>
    </td>
  </tr>
  <tr> 
    <td align="left" valign="middle" class="listing">&nbsp;</td>
  </tr>
  <tr> 
    <td align="left" valign="middle" class="recipe_top"><strong>Στείλτε το σχόλιο 
      σας&#58; </strong></td>
  </tr>
  <tr> 
    <td align="left" valign="middle" class="listing"> 
      <?

if &#40;$_SESSION&#91;auth&#93; == "1"&#41;
&#123;
echo "
<br>
<form method=\"post\" name=\"submit\" target=\"_self\" action=\"recipe.php\">

<input type=\"hidden\" name=\"action\" value=\"add_comments\">

<input type=\"hidden\" name=\"recipe_id\" value=\"$_REQUEST&#91;recipe_id&#93;\">
<br> 

Όνομα&#58; 
<input type=\"text\" name=\"comments_user\">
<br>
<br>


Σχόλιο&#58;
<br>

<textarea cols=\"40\" rows=\"5\" name=\"comments_content\"></textarea>
<br>
<br>
<input type=\"submit\" value=\"Προσθήκη\">
<input type=\"reset\" value=\"Καθαρισμός\">
</form>

";
&#125;else
&#123;
echo "Θα πρέπει να είστε μέλος για να μπορέσετε να αποστείλετε σχόλιο, μπορείτε να γίνετε εύκολα και γρήγορα μέλος απο το ανάλογο πεδίο της ιστοσελίδας, εάν είστε ήδη μέλος παρακαλώ κάντε είσοδο στο λογαριασμό σας.";
&#125;


?>
    </td>
  </tr>
  <tr> 
    <td align="center" valign="middle" class="listing"> 
      <?php if &#40;$print != "yes"&#41; &#123; 

//echo "<strong><a href=\"recipe.php?action=send_mail&recipe_id=$recipe_id&amp;recipe_category_1=$recipe_category_1\">$lang_request_form<a/></strong>
echo "
<br />
<br />
<a href=\"recipe.php?action=$_REQUEST&#91;action&#93;&amp;recipe_id=$_REQUEST&#91;recipe_id&#93;&amp;photo=$photo&amp;print=yes\" target=\"_blank\">$lang_print_view</a>
<br />
<br />
<a href=\"user_recipe.php?action=add_love&amp;recipe_id=$_REQUEST&#91;recipe_id&#93;\">Προσθήκη της συνταγής στις αγαπημένες μου</a>
<br />

"; &#125;else
&#123;
echo "$site_title";
&#125;
 ?>
    </td>
  </tr>
</table>
 <?php
&#125;
/////////////////////// emfanisi eggrafis ////////////////////////////////////////// 
if &#40;$action == "search"&#41;
&#123;
?>
Εικόνα

Άβαταρ μέλους
Basilakis
PHP Moderator
Δημοσιεύσεις: 8574
Εγγραφή: 17 Νοέμ 2003 13:03
Τοποθεσία: Womans' Brain
Επικοινωνία:

php help recipes .php

Δημοσίευση από Basilakis » 03 Σεπ 2009 10:42

Find

Κώδικας: Επιλογή όλων

&#125;else if &#40;$recipe->recipe_photo_5 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_5";
&#125;else
&#123;
$photo = "no_photo.jpg";
&#125; 
Replace with

Κώδικας: Επιλογή όλων

&#125;else if &#40;$recipe->recipe_photo_5 != ""&#41;
&#123;
$photo = "$recipe->recipe_photo_5";
&#125;

Άβαταρ μέλους
Banavas
Script Master
Δημοσιεύσεις: 1367
Εγγραφή: 21 Νοέμ 2004 20:25
Επικοινωνία:

php help recipes .php

Δημοσίευση από Banavas » 03 Σεπ 2009 13:19

Σωστή η απάντηση του Βασιλάκη αλλά αν η έλλειψη της φωτογραφίας σου χαλάει την τοποθέτηση της συνταγής στη σελίδα, μπορείς να κάνεις την no_photo.jpg μια transparent εικόνα με ίδιες διαστάσεις, οπότε η εικόνα θα λειτουργήσει σαν spacer.
Happy coding....
Μάρκος
http://lasernet.gr

Άβαταρ μέλους
Nektarios333
Δημοσιεύσεις: 136
Εγγραφή: 26 Μαρ 2007 17:58
Επικοινωνία:

php help recipes .php

Δημοσίευση από Nektarios333 » 03 Σεπ 2009 22:30

Παιδιά σας ευχαριστώ πάρα πολλή :wink:
Εικόνα

Απάντηση

Επιστροφή στο “PHP Προγραμματισμός”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 0 επισκέπτες