Jump to content

HCProfessionals

Members
  • Posts

    107
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

HCProfessionals's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Everything works great, except the part where I am trying to get the mysql_num_rows for each category - $jobsc_row['job_category'] <?php $jobsc_query = "SELECT j.id, j.jobc_name, c.job_category FROM site_jobscats AS j LEFT JOIN site_jobs AS c ON j.id=c.job_category WHERE jobc_active='1'"; $jobsc_result = mysql_query($jobsc_query) or die("There was a problem with the SQL query: " . mysql_error()); while ($jobsc_row = mysql_fetch_array($jobsc_result)) { $jobcatid = $jobsc_row['id']; $jobcatname = $jobsc_row['jobc_name']; $jobcatcount = mysql_num_rows($jobsc_row['job_category']); echo "<li><a href=\"jobs.php?cat=$jobcatid\">$jobcatname [$jobcatcount]</a></li>"; } ?>
  2. <script type="text/javascript"> $(document).ready(function() { $("#photo_id").fancybox().trigger('click'); }); </script> I'm triggering a specific photo in fancybox when the page loads. How can I put the following options inside of the function? boxOptions: { beforeShow: function () { if (this.title) { this.title += '<br /><br />'; this.title += '<img src="../wallpapers/images/facebook.png" border="0" /> <a href="http://www.facebook.com/sharer.php?u=' + this.href + '" target="_blank">Share on Facebook</a>'; this.title += ' | '; this.title += '<a href="http://pinterest.com/pin/create/button/?url=' + this.href + '" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>'; this.title += ' | '; this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=' + this.href + '&layout=button_count&show_faces=false&width=500&action=like&font&colorscheme=light&height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>'; } }, helpers : { title : { type: 'inside' }, } }
  3. It is reporting an error for: //Put files data into a multi-dimensional array foreach ($queue as $file) Warning: Invalid argument supplied for foreach()
  4. Currently I'm using the asort function to list by filename, but I'm trying to list by filetime to order from most newest file upload to oldest. function listQueue($queue, $path) { arsort($queue); foreach ($queue as $file) { listFile($file, $path); } } function listFile($file, $path) { list($width, $height, $type, $attr) = getimagesize($path.$file); $image_size = imageSize($path.$file); echo "<a href=\"".$path.$file."\"><img src=\"getimage.php?img=".str_replace("./download/", "", $path.$file)."&w=140&h=79\" alt=\"".date("F d, Y", filemtime($path.$file))."\" title=\"Resolution: ".$width."x".$height.". Filesize: ".$image_size.". Date Uploaded: ".date("F d, Y", filemtime($path.$file)).".\" /></a>"; }
  5. I am having a difficult time displaying arrays to an actual file list What I currently have for code: <?php $dir = 'download/'; $results = array(); if (is_dir($dir)) { $iterator = new RecursiveDirectoryIterator($dir); foreach ( new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file ) { if ($file->isFile()) { $thispath = str_replace('\\', '/', $file); $thisfile = utf8_encode($file->getFilename()); $results = array_merge_recursive($results, pathToArray($thispath)); } } } echo "<pre>"; print_r($results); function pathToArray($path , $separator = '/') { if (($pos = strpos($path, $separator)) === false) { return array($path); } return array(substr($path, 0, $pos) => pathToArray(substr($path, $pos + 1))); } ?> Which Will Display: Array ( [download] => Array ( [folder1] => Array ( [0] => image1.jpg [1] => image2.jpg [2] => image3.jpg [3] => image4.jpg [4] => image5.jpg ) [folder2] => Array ( [0] => image1.jpg [1] => image2.jpg [2] => image3.jpg [3] => image4.jpg [4] => image5.jpg ) ) ) What I am looking for as a display: - Not to show the download folder, only subs <div class="images"> <div title="folder1"> <img src="download/folder1/image1.jpg" /> <img src="download/folder1/image2.jpg" /> <img src="download/folder1/image3.jpg" /> <img src="download/folder1/image4.jpg" /> <img src="download/folder1/image5.jpg" /> </div> <div title="folder2"> <img src="download/folder2/image1.jpg" /> <img src="download/folder2/image2.jpg" /> <img src="download/folder2/image3.jpg" /> <img src="download/folder2/image4.jpg" /> <img src="download/folder2/image5.jpg" /> </div> </div>
  6. I figured it out after playing around. SELECT p.arc_pid, p.arc_pname, p.arc_pdescription, p.arc_pprice, p.arc_pbuylink, i.arc_ilink, c.arc_cid, c.arc_cname FROM arc_products AS p LEFT JOIN arc_images AS i ON p.arc_pid=i.arc_pid LEFT JOIN arc_categories AS c ON p.arc_pcategory=c.arc_cid WHERE arc_pactive='1' ORDER BY FIELD(arc_cid, '1') DESC, arc_pname ASC
  7. Ok, here's my current query: SELECT p.arc_pid, p.arc_pname, p.arc_pdescription, p.arc_pprice, p.arc_pbuylink, i.arc_ilink, c.arc_cid, c.arc_cname FROM arc_products AS p LEFT JOIN arc_images AS i ON p.arc_pid=i.arc_pid LEFT JOIN arc_categories AS c ON p.arc_pcategory=c.arc_cid WHERE arc_pactive='1' ORDER BY arc_cid ASC, arc_pname ASC What I want is to sort where arc_cid='1' then sort the rest by arc_pname ASC. I'm sure I'll have to use a case, but I'm just not sure.
  8. I'm pulling a date from an RSS Feed and need to convert it to something a little nicer. Possible? Current Date: Tue, 12 Jun 2012 07:49:25 PDT What I want: Tuesday, June 12, 2012
  9. I am building a program to allow users to include a bio for themselves. The problem is, if they enter a special character into the textarea, MySQL throws errors. How can I fix this?
  10. Wow, totally missed that. Thank You!!!!
  11. I'm not really getting anywhere... $option_results = mysql_query("SELECT product_options FROM products WHERE product_id='".$product."'"); while($option_row = mysql_fetch_array($option_results)){ $sep_option = explode("::", $option_row[0]); foreach ($sep_option as $sep_result) { $option_part = explode(",", $sep_result); $option_part[0] = $option_name; $option_part[1] = $option_price; echo "<li class=\"product\" id=\"option-".$option_name."\"><input class=\"purchase\" type=\"button\" value=\"Add to cart\"><span class=\"title\">".$option_name."</span>, Add $<span class=\"price\">".$option_price."</span></li>"; } }
  12. I'm trying to add options to products. Currently, I have them in this format: Leather reinforced hilt,5.00::Stabbing tip,3.00::Logo,10.00 $option_results = mysql_query("SELECT product_options FROM products WHERE product_id='".$product."'"); while($option_row = mysql_fetch_array($option_results)){ $option = explode("::", $option_row[0]); $option_part = explode(",", $option[0]); $option_part[0] = $option_name; $option_part[1] = $option_price; echo "<li><a href=\"#\">".$option_name.", Add $".$option_price."</a></li>"; } I would like the output to be: <li><a href="#">Leather reinforced hilt, Add $5.00</a></li> <li><a href="#">Stabbing tip, Add $3.00</a></li> <li><a href="#">Logo, Add $10.00</a></li>
  13. I have this so far, but it isn'tworking... <script type="text/javascript" language="javascript"> $(document).ready(function() { $("#product-image-buy-link").click(function(){ $("#top-bar-content-items").effect( "highlight", {color:"#FFF"}, 3000 ); }); }); </script> <span id="top-bar-content-items">You have <span class="cart-quantity">0</span> products in your cart</span> <span id="product-image-buy-link" class="purchase">add to cart</span>
  14. I need a highlighter effect using onclick. Basically when someone clicks "add to cart" I want the cart quantity "<span class="cart-quantity"></span>" to highlight for a second or two and then fade.
  15. Basically, the only thing I need to figure out is how to pull the multiple images now for the slideshow along with a thumbnail for each.
×
×
  • 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.