without seeing your actual code, i'm going to do a little guessing, but this
should get you started. feel free to ask followup questions.
1. different header image and links based on log in status:
this example is based on the default 0.8.1 s_header file. it will change
the image and links based on login status.
original code
[code]
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td height="1" valign="top"><table width="100%" border="0"
cellpadding="6" cellspacing="0" class="header">
<tr>
<td align=center><?php echo $vendor_image ?> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="mainmenu">
<tr>
<td align=center><table width="400" border="0" cellpadding="4"
cellspacing="0">
<tr>
<td align="center"> <a class="wLink" href="<?php
$sess->purl(URL . "?page=shop/index");?>"><?php echo $home_title ?></a></td>
<td align="center" nowrap="nowrap"><a
class="wLink"href="<?php $sess->purl(URL . "?page=shop/cart");?>"><?php echo
$cart_title ?></a></td>
<td align="center" nowrap="nowrap"><a class="wLink"
href="<?php $sess->purl(SECUREURL . "?page=checkout/index");?>"><?php echo
$checkout_title ?></a></td>
<td align="center" nowrap="nowrap"><?php
if ($auth["perms"]) {
echo "<A class=\"wLink\" HREF=";
$sess->purl(URL . "?page=$modulename/index&func=userLogout");
echo ">$logout_title</A>";
} else {
echo "<A class=\"wLink\" HREF=";
$sess->purl(SECUREURL . "?login=1&$QUERY_STRING");
echo ">$login_title</A>";
} ?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
[/code]
could be changed to:
[code]
<table width="100%" height="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td height="1" valign="top"><table width="100%" border="0"
cellpadding="6" cellspacing="0" class="header">
<tr>
<td align=center>
<?php
if ($auth["perms"]) {
echo $vendor_image; // this is a preformatted IMG html string
created in global.inc
} else {
echo "<img src='images/not_logged_in.jpg' border=0>"; // substitute
your image name here
}
?>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="mainmenu">
<tr>
<td align=center><table width="400" border="0" cellpadding="4"
cellspacing="0">
<tr>
<td align="center"> <a class="wLink" href="<?php
$sess->purl(URL . "?page=shop/index");?>"><?php echo $home_title ?></a></td>
<td align="center" nowrap="nowrap"><a
class="wLink"href="<?php $sess->purl(URL . "?page=shop/cart");?>"><?php echo
$cart_title ?></a></td>
<td align="center" nowrap="nowrap"><a class="wLink"
href="<?php $sess->purl(SECUREURL . "?page=checkout/index");?>"><?php echo
$checkout_title ?></a></td>
<td align="center" nowrap="nowrap"><?php
if ($auth["perms"]) {
echo "<A class=\"wLink\" HREF=";
$sess->purl(URL . "?page=$modulename/index&func=userLogout");
echo ">$logout_title</A>";
} else {
echo "<A class=\"wLink\" HREF=";
$sess->purl(SECUREURL . "?login=1&$QUERY_STRING");
echo ">$login_title</A>";
} ?>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
[/code]
if you're using image maps, then you won't need the lower PERMS section, but
instead put all your image and mapping informtion in the the top PERMS
section.
2. as soon as you click on any category, you're activating the "browse"
page.
not sure what exact issue you're seeing with the category browse, but there
is an issue with the current category listing method, as it will only show
you the products assigned to a category, and not all the products listed in
sub cats under that category (so if the main cat is empty, but the sub cats
have products, clicking on the main will show you nothing).
i created a revised category product listing that recursively searches the
current category (and sub cats) to pull all the products assigned and
display them - its a drill-down approach. as you click down the
subcategories, you narrow your list of products. it's below.
original code in browse.ihtml (from 0.8.1):
[code]
<?php
$ps_product_category->print_child_list($category_id);
?>
<br />
<?php
$list = "SELECT * FROM product, category, product_category_xref WHERE
";
$count = "SELECT count(*) as num_rows FROM product,
product_category_xref, category WHERE ";
$q = "product_category_xref.category_id='$category_id' ";
$q .= "AND category.category_id=product_category_xref.category_id ";
$q .= "AND product.product_id=product_category_xref.product_id ";
$q .= "AND product.product_parent_id='' ";
$q .= "AND product.product_publish='Y' ";
$q .= "ORDER BY category.category_name ASC";
$list .= $q . " LIMIT $offset, " . SEARCH_ROWS;
$count .= $q;
}
[/code]
change it to:
[code]
<?php
$ps_product_category->print_child_list($category_id);
?>
<p>
<?php
function get_recursive_categories($category_id) {
$s = "";
$q = "select category_child_id from category_xref where
category_parent_id = '" . $category_id . "' ";
$db = new ps_DB;
$db->query($q);
if ($db->num_rows()) {
while ($db->next_record()) $s .= get_recursive_categories
($db->f("category_child_id"));
}
$s .= "OR (product_category_xref.category_id = '" . $category_id . "' AND
product_category_xref.product_id = product.product_id) ";
return $s;
}
$list = "select * from product, product_category_xref where ";
$count = "select count(*) as num_rows from product, product_category_xref
where ";
$q = "((product_category_xref.category_id = '" . $category_id . "' AND
product_category_xref.product_id = product.product_id) ";
$q .= get_recursive_categories($category_id) . ") ";
$q .= "AND product.product_publish='Y' ";
$list .= $q . " LIMIT $offset, " . SEARCH_ROWS;
$count .= $q;
}
[/code]
3. to answer your question about having multiple browse pages (one for each
category) - yes, could be done. you could reuse the category_flypage field
in the category table to enter/store the name of the browse page you'd like
that category to use, then just make sure to update the navigation code
(modify the navigation_list function in ps_product_category and the
s_header/c_header pages) to pull that field and use it in place of the
static browse name.
for example, in the navigation_list function in ps_product_category, change
this line:
[code]
$link .= $sess->url(URL .
"?page=shop/browse&category_id=$category_id");
[/code]
to this:
[code]
$link .= $sess->url(URL .
"?page=shop/" . $db->f("category_flypage") .
"&category_id=$category_id");
[/code]
where you might store the word "browse_a" in that field to reference the
file browse_a.ihtml
4. storing multiple images for a product or category is relatively simple -
just add more fields to the respective tables, then duplicate the code that
allows them to be entered and displayed (entered/updated:
product/product_form and category/category_form, displayed: browse and
flypage). for the "gallery" that you're describing, you'll need to find a
version that you like, and just implement it in the respective pages (they
are generally javascript to prevent page updates from being necessary).
just replace the static SRC images with the images pulled from the database
(that sounds easy, and should be pretty straightforward).
here's a real rough, but working, javascript gallery example.
http://www.newmanit.com/untitled.htm
it's all rollover based, but when you click on the left-hand thumbs, the
bottom thumbs change and stick. roll over the bottom thumbs to update the
main image.
and here's how it might look with the db references pulled in
http://www.newmanit.com/untitled.txt
not tested, but you should be able to see where and how the db references
would be put in instead.
concerning "Also if possible if selecting the different colour in the drop
down menu will automatically change the "group" of images."
i think the above example will do as you were thinking with the function of
the upper thumbnails.
how's that for a stab at what you were asking for?
Sent: Saturday, March 14, 2009 6:26 PM
Subject: [phpshop] phpshop modification help/advice
>