Jump to content

rodneykm

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

rodneykm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I havent used many free ones. I use a combo of Dreamweaver and PHPEd
  2. That has me REALLY close. Heres the code. It displays 5 rows and 3 columns, but its all repeat data. (hope that makes sense). [code]// display categories on main page - gallery.php function display_categories($cats) {     global $file; // Print Table print('<table id="display_categories" columnspan="3" rowspan="3">'."\r\n"); $rows = 5; $columnsPerRow = 3; for($r = 0; $r < $rows; $r++) { echo "<tr>"; for($c = 0; $c < $columnsPerRow; $c++) { /*print ('<pre>'); print_r ($cats); print ('</pre>'); */ foreach($cats as $key=>$value) { //while ($next = next($cats)){     //$key = key($cats); //$value = key($cats); $title = '<b>'.$key.'</b>:<br />'; //Output Thumbnail Images print('<td style="width: '. THMBWIDTH .'px; height: '. THMBHEIGHT .'px;">'); if(is_array($value)) {             foreach($value as $k2=>$v2) {                 if(is_dir(PATH.$file.'/'.$key.'/'.$k2))                     $subcats[$k2] = $v2;                 else                     $subimgs[] = $v2;             }             $imgloc = !empty($subimgs) ? rawurlencode($file.'/'.$key.'/'.reset($subimgs)) : null;             $alt = !empty($subimgs) ? reset($subimgs) : 'no image'; // Show Gallery Main Image print('<a href="'.SELF.'?file='.rawurlencode($file.'/'.$key).'">');             print('<img src="imgsrc.php?src='.$imgloc.'" alt="'.$alt.'" />');             print('</a>'."\r\n"); // Gallery Information (Image size, gallery name, etc...) echo "<br>".$title;             echo @count($subcats).' sub-categories<br />';             echo @count($subimgs).' images'; print('</td>    <td class="category">'."\r\n"); unset($subcats, $subimgs);         } else {             print('<img src="imgsrc.php?src=null" alt="no image" />');             print('</td><td class="category">'."\r\n");             echo $title;             print('0 sub-categories<br />');             print('0 images');         }         print("\r\n".'</td>'."\r\n"); } } } echo "</tr>";} [/code]
  3. Yeah definitely will need that. Any help is greatly appriciated.
  4. Horizontally for sure. [quote author=HuggieBear link=topic=111232.msg450723#msg450723 date=1160609832] In which order do you want the data displayed, horizontally or vertically?  If you're not sure what I mean, check out [url=http://www.phpfreaks.com/forums/index.php/topic,109401.msg441016.html#msg441016]this post[/url] Regards Huggie [/quote]
  5. My best shot so far...I'm really stumped on this. Seems like it should be SO easy. [code]// display categories on main page - gallery.php function display_categories($cats) {     global $file; // Print Table print('<table id="display_categories" columnspan="3" rowspan="3">'."\r\n"); foreach($cats as $key=>$value) { // While $j equals 1, print data out while ($j = 1){ echo "<tr>"; $title = '<b>'.$key.'</b>:<br />'; //Output Thumbnail Images print('<td style="width: '. THMBWIDTH .'px; height: '. THMBHEIGHT .'px;">'); if(is_array($value)) {             foreach($value as $k2=>$v2) {                 if(is_dir(PATH.$file.'/'.$key.'/'.$k2))                     $subcats[$k2] = $v2;                 else                     $subimgs[] = $v2;             }             $imgloc = !empty($subimgs) ? rawurlencode($file.'/'.$key.'/'.reset($subimgs)) : null;             $alt = !empty($subimgs) ? reset($subimgs) : 'no image'; // Show Gallery Main Image print('<a href="'.SELF.'?file='.rawurlencode($file.'/'.$key).'">');             print('<img src="imgsrc.php?src='.$imgloc.'" alt="'.$alt.'" />');             print('</a>'."\r\n"); // Gallery Information (Image size, gallery name, etc...) echo "<br>".$title;             echo @count($subcats).' sub-categories<br />';             echo @count($subimgs).' images'; print('</td>    <td class="category">'."\r\n"); unset($subcats, $subimgs);         } else {             print('<img src="imgsrc.php?src=null" alt="no image" />');             print('</td><td class="category">'."\r\n");             echo $title;             print('0 sub-categories<br />');             print('0 images');         }         print("\r\n".'</td></tr>'."\r\n");     }     print('</table>'."\r\n"); } echo "</tr>" $j++; }[/code]
  6. The code below displays the first picture from any directory inside the directory in which it sits. My problem is that it only displays them in one column. For the life of me I cant figure out how to get this into multiple columns and rows...say 3 x 5 or so. Any have any suggestions? Any help at all would be very appriciated. [code]// display categories on main page - gallery.php function display_categories($cats) {     global $file; // Print Table print('<table id="display_categories" >'."\r\n"); while ($next = next($cats)){     $key = key($cats); $value = $next; $title = '<b>'.$key.'</b>:<br />'; //Output Thumbnail Images print('<td style="width: '. THMBWIDTH .'px; height: '. THMBHEIGHT .'px;">'); if(is_array($value)) {             foreach($value as $k2=>$v2) {                 if(is_dir(PATH.$file.'/'.$key.'/'.$k2))                     $subcats[$k2] = $v2;                 else                     $subimgs[] = $v2;             }             $imgloc = !empty($subimgs) ? rawurlencode($file.'/'.$key.'/'.reset($subimgs)) : null;             $alt = !empty($subimgs) ? reset($subimgs) : 'no image'; // Show Gallery Main Image print('<a href="'.SELF.'?file='.rawurlencode($file.'/'.$key).'">');             print('<img src="imgsrc.php?src='.$imgloc.'" alt="'.$alt.'" />');             print('</a>'."\r\n"); // Gallery Information (Image size, gallery name, etc...) echo "<br>".$title;             echo @count($subcats).' sub-categories<br />';             echo @count($subimgs).' images'; print('</td>    <td class="category">'."\r\n"); unset($subcats, $subimgs);         } else {             print('<img src="imgsrc.php?src=null" alt="no image" />');             print('</td><td class="category">'."\r\n");             echo $title;             print('0 sub-categories<br />');             print('0 images');         }         print("\r\n".'</td>'."\r\n");   print('</table>'."\r\n"); } } [/code]
×
×
  • 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.