Community Forums 

Main Content

Re:New WEb Site Design

    Apr 01 2012 16:53:25

    #1

    Yahweh's Alive & Well

    Join date : 2008-10-01      Posts : 123

    anon,

    thank you for responding! I am new with php and don't understand enough to edit files and make it come out right like I can with html files. So I really don' t understand what you you are suggesting I do.

    Maybe this will help?

    The section to display the button in the first file is this

    // START ORDER DETAILS W/ BUTTON
    if (!empty($display_orderbutton))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_qty</td><td valign=\"top\" align=\"left\">$display_showqty   $display_orderbutton $display_registrybutton</td></tr>";
    else if (!empty($display_registrybutton))
    echo "<tr><td valign=\"top\" colspan=\"2\">$display_registrybutton</td></tr>";

    // DESCRIPTION
    if (!empty($display_description))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_description</td></tr>";

    echo "</table>";
    echo "</div>";
    if (!empty($display_formflds))
    echo "</form>";

    (which has the product description inserted below the button and they are within the same form) I figured this out because the buy button was below the description at first and moving it here put the button above it.

    I tried putting this code minus the DESCRIPTION into the first file's code in place of

    // DISPLAY PRODUCT PRICE RANGES
    if (!empty($display_pricerange) AND $show_prices == "yes")
    echo $display_priceoos ."<br />";

    then in the same file under
    // CREATE VARS

    I made it
    // CREATE VARS
    $display_outofstock = var_oos($searchrow[OutOfStock], $searchrow[Inventory], $inventorycheck);
    $priceset = var_optchk($display_outofstock, $chkoptsnum);
    $stripitem = var_item($searchrow[Item]);
    $stripalt = var_alt($stripitem, $searchrow[Keywords], $use_alt_kw);
    $Show_Ord_Button = var_showorder($unitprice, $chkoptsnum, $Set_Ord_Button, $show_prices);
    $multitemlink = doItemLink (stripslashes($searchrow[Item]), $searchrow[0], "auto");
    $display_imglink1 = var_imglink($searchrow[SmImage], $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($searchrow[SmImage2], $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($searchrow[SmImage3], $multitemlink, $stripitem, $stripalt, "smalllinkimage3");
    $display_itemlink = "<a href=\"$multitemlink\" class=\"itemcolor\">" .stripslashes($searchrow[Item]) ."</a>";
    $display_orderbutton = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "button");
    $display_showqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "show");
    $display_hiddenqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "hide");

    So this is what I ended up with

    <?php
    if (file_exists("openinfo.php") OR isset($_REQUEST['dblink']) OR empty($dblink))
    die("Cannot open file.");

    require_once(SB_INC_DIR ."/products_variables.php");

    // START TABLE
    echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" ";
    if ($Line_Color)
    echo "class=\"linetable\" ";
    echo "style=\"width: 100%\">";

    if ($Item_Columns > 0)
    $tcwidth = floor(100/$Item_Columns);

    // CREATE ITEM BOXES
    if (($page == "_all" OR $page == "all") AND $totalsearchnum > 0)
    $totscount = $totalsearchnum;
    else
    $totscount = $Item_Columns * $Item_Rows;

    for ($scount = 1; $searchrow = mysql_fetch_array($searchresult), $scount <= $totscount; ++$scount)
    {
    $totalinvcount = 0;

    // ATTRIBUTE QUERY
    $chkoptsquery = "SELECT Attributes FROM " .SB_DB_PREFIX ."_options WHERE ItemID='" .(int)$searchrow[ID] ."' AND Active='Yes' AND OptionNum='1' AND Attributes LIKE '%:%' LIMIT 1";
    $chkoptsresult = mysql_query($chkoptsquery, $dblink) or die ("Unable to access database.");
    $chkoptsnum = mysql_num_rows($chkoptsresult);
    $chkoptsarray = array();
    if ($chkoptsnum == 1)
    {
    $chkoptsrow = mysql_fetch_row($chkoptsresult);
    $chkoptsarray = explode("~", $chkoptsrow[0]);
    }

    // CREATE VARS
    $display_outofstock = var_oos($searchrow[OutOfStock], $searchrow[Inventory], $inventorycheck);
    $priceset = var_optchk($display_outofstock, $chkoptsnum);
    $stripitem = var_item($searchrow[Item]);
    $stripalt = var_alt($stripitem, $searchrow[Keywords], $use_alt_kw);
    $Show_Ord_Button = var_showorder($unitprice, $chkoptsnum, $Set_Ord_Button, $show_prices);
    $multitemlink = doItemLink (stripslashes($searchrow[Item]), $searchrow[0], "auto");
    $display_imglink1 = var_imglink($searchrow[SmImage], $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($searchrow[SmImage2], $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($searchrow[SmImage3], $multitemlink, $stripitem, $stripalt, "smalllinkimage3");
    $display_itemlink = "<a href=\"$multitemlink\" class=\"itemcolor\">" .stripslashes($searchrow[Item]) ."</a>";
    $display_orderbutton = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "button");
    $display_showqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "show");
    $display_hiddenqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "hide");

    // BREAK IF FINISHED
    if ($scount % $Item_Columns == 1 AND $scount > $searchnum)
    break;

    // START TABLE ROWS
    if ($scount % $Item_Columns == 1)
    echo "<tr>";
    echo "<td align=\"center\" valign=\"top\" ";
    if ($Line_Color)
    echo "class=\"linecell\" ";
    echo "style=\"width: $tcwidth%\">";

    // DISPLAY PRODUCT DETAILS ONLY IF A PRODUCT EXISTS
    if (!empty($searchrow[0]))
    {

    // DISPLAY PRODUCT IMAGES
    if (!empty($display_imglink1))
    echo $display_imglink1;

    // DISPLAY PRODUCT NAME
    if (!empty($display_itemlink))
    echo $display_itemlink ."<br />";

    // START ORDER DETAILS W/ BUTTON
    if (!empty($display_orderbutton))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_qty</td><td valign=\"top\" align=\"left\">$display_showqty   $display_orderbutton $display_registrybutton</td></tr>";
    else if (!empty($display_registrybutton))
    echo "<tr><td valign=\"top\" colspan=\"2\">$display_registrybutton</td></tr>";

    echo "</table>";
    echo "</div>";
    if (!empty($display_formflds))
    echo "</form>";

    }
    // END PRODUCT

    echo "</td>";
    if ($scount % $Item_Columns == 0)
    echo "</tr>";
    }
    // END TABLE ROWS

    // EMAIL FRIEND LINK
    if (!empty($display_emailpg))
    echo "<tr><td class=\"accent\" align=\"center\" colspan=\"$Item_Columns\">$display_emailpg</td></tr>";
    echo "</table>";
    ?>

    If you would like I will post the product_variables.php

    Will it help if I post links to the pages being displayed?