Jump to content

fubarur

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by fubarur

  1. Thank you for your advice. That did not work for some reason but I did get this to work <?php if (file_exists('/var/www/html/images/races/' . $row['id'] . '/images/' . $row['id'] . $dthumb)): ?>
  2. So I am trying to tweak a few things on a page and I am stuck on this one. I want the ###### to also be the data in $row['id'] <?php if (file_exists('/var/www/html/images/races/######/images/' . $row['id'] . $dthumb)): ?> so if $row['id'] = 124 it would be looking for /var/www/html/images/races/124/images/124.jpg')) I know it has to be that I am stumped on the correct question to ask or search for. Any help is appreciated. Thanks!
  3. Ken, you are my savior! This is why this site rocks! thanks again!!
  4. Thanks Ken I tried <?php // Scratch & Dent if ($product['sub_category_id'] == 79000) ?> <tr><td colspan="2" class="font-smx"><?=display_cms_data(160)?></td><tr> <?php else: ?> No change, any ideas?
  5. Ok this one is driving me crazy... I have product categories and I want a little snipet of html to be displayed if someone looks a one certain category category is 79000 <?php // Scratch & Dent echo $product['sub_category_id']; if ($product['sub_category_id'] == 79000); ?> <tr><td colspan="2" class="font-smx"><?=display_cms_data(160)?></td><tr> <?php else: ?> What happens is that no matter what category that is viewed this html gets displayed. I have added the echo line when I was having issues to make sure that I had it pulling from correct area. When I view the 79000 category I see the correct echo number and get the html displayed, but when viewing another category (lets say 36800) echo line says 36800 and html is still displayed. What am I doing wrong? Thanks in advance.
  6. Thanks premiso, Not what I'm looking for, my issue is more of a PHP not a form to allow someone to enter a value. So if someone adds a item to their cart that costs $20 a popup window pops and and says something like get a better shipping rate by adding more than $50 If they had more than $50 in the cart nothing would happen. This is what displays the subtotal on the page CartSession::subtotal_cost() Thanks
  7. Correct I know I need to use Java, I guess what I'm looking for is help on how to set up the if statement? and where to place the call for the java
  8. Thanks in advance for any help... I have a cart page the shows a subtotal CartSession::subtotal_cost() I want to make it so if the subtotal is below $50 it opens a Popup to send the user a message? popup page is /popup/50.php else no popup Any ideas? Thanks
  9. Thanks that seems to be working! good thing sites like this exist!
  10. Ok please be gentle ??? I have searched all over and can not seem to find an answer, I think because I'm not sure what exactly would be the correct phrase to search under. What I'm trying to do is Example www.XXXX.com/products/item.php (product example widgets) (this page shows basic product info, with links to more detail info like a manual) So if I linked to www.XXXX.com/products/item.php?type=manual it would then pull up a php page that has the manual on it... The thing that confuses me is the whole ?type=manual How do I se that up to call for the manual page in a "if" statement... Hope someone can this noob. I hope I gave enough info to point me in the right direction Thanks
  11. Good news! After looking at all your help I messed around with the code and got it to work! if (file_exists("/var/www/html/images/events/$id/images/header_1.jpg")) { echo"<img border='0' src='/images/events/$id/images/header_1.jpg'></img>"; }else{ echo"<img border='0' src='images/header.jpg'></img>"; } ?> Thanks for all your help and guidance!
  12. Ok, I think this is what you are talking about, but I used this code below and get a blank page? <?php if (file_exists("/images/events/$id/images/header_1.jpg")) ?> <img border="0" src="<?=Environment::webroot()?>/images/events/$id/images/header_1.jpg"> <?php else; ?> <img border="0" src="<?=Environment::webroot()?>/images/header.jpg"> Your code <?php if (file_exists("/images/events/$id/images/header_1.jpg")) { echo"<img border='0' src='/images/events/$id/images/header_1.jpg'></img>>"; }else{ echo"<img border='0' src='images/header.jpg'></img>"; } ?> Gives me a page but its not finding the image, and its there?
  13. This gave me a blank page like the last one did <?php if (file_exists("/images/event/$id/images/header_1.jpg")) { <img border="0" src="<?=Environment::webroot()?>/images/event/$id/images/header_1.jpg>" /> } else { <img border="0" src="<?=Environment::webroot()?>/images/header_1.jpg>" /> } ?> With the above code removed page loads fine
  14. I tried this and it did not work? <?php if (file_exists("<?=Environment::webroot()?>/images/event/$id/images/header_1.jpg")) { <img border="0" src="<?=Environment::webroot()?>/images/event/$id/images/header_1.jpg>" /> } else { <img border="0" src="<?=Environment::webroot()?>/images/header_1.jpg>" /> } ?>
  15. I need help on a bit of code to look in a folder and see if there is a image with a certain name, if there is not one display this image instead. The details looking into this folder /images/event/XX/images/ XX is $id so it is a variable depending on the event you are looking at. The image name header_1.jpg else if it can not find the above load this default image /images/event_header.jpg Any help or pointers would be appreciated. I'm sure this is a noob type question, but I'm learning and this is one great resource!
  16. Nope, I can't get it to work :'(
  17. I will try it out, will this replace my current "$sql ="
  18. I have yet to figure this one out.... ??? Please someone save me from destruction
  19. To make it a bit more clear this might help? $sql = 'SELECT id, type_id, title FROM article ' . 'LEFT JOIN article_access_level ON article.id = article_access_level.article_id ' . 'WHERE article.id = ' . $id; This finds the article # and displays the article info on the page I now want to find what type of article it is Table: placement_type Within the fields Article_id This is the Article ID from above query placement_id This tells what type of article that Article ID is So I want to match the Article ID with the type, does that make sense? I'm starting to confuse even myself Thanks for any help....
  20. Ok, I'm new and trying to learn all this... I have a page that is querying for a certain table and whats inside to display an article on a page. (it works fine) Now I need to query another table to find out where the placement type for this article is. (this is my problem) The new table is: article_placement fields inside are article_id placement_id The code I have is: <?php ob_start(); require_once('Ambiance/Environment/co.fubsa.php'); Environment::InitializeVDDB(Environment::dsn()); Environment::LoadForms(array('ShoppingCart')); require_once('HTTP.php'); // Grab article id $id = $_REQUEST['article-id']; // Validate article id if(!Ambiance_HTML_Form_Validation::test($id, '0123456789', true, 10)): HTTP::redirect(Environment::webroot() . '/index.php', true); endif; // prepare product sql statement $sql = 'SELECT id, type_id, title FROM article ' . 'LEFT JOIN article_access_level ON article.id = article_access_level.article_id ' . 'WHERE article.id = ' . $id; if($_REQUEST['command'] != 'preview'): $sql .= ' AND article_access_level.access_level_id = 1'; endif; // Select product info $article = $db->getRowEx($sql); if(!is_array($article)): HTTP::redirect(Environment::webroot() . '/index.php', true); endif; require_once('Ambiance/Modules/VDFileAccess.php'); // Document path $article_path = '/var/www/html/articles/' . $id . '/'; ?> Any ideas?
  21. Nope that will not work the number spit out from "Environment::number_format(CartSession::subtotal_cost())" would look like $50 so without the $ it can not compare it. any other ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.