changing catagory & album list from rows to colums changing catagory & album list from rows to colums
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

changing catagory & album list from rows to colums

Started by heartsy, November 27, 2007, 07:30:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

heartsy

I would like to have the list of catagories and albums display in columns flowing down my page, instead of the rows going across the page.
This is what my gallery looks like now... http://heartsy.com/photos2.htm
And this is what I want it to look like... http://heartsy.com/photogallerysample.htm
I don't know how to write code, so I basically rearranged things in an html editor off the view from the index, so the links will not work.

After reading several threads, and some of the turtorials, I think I need to edit the theme.php? And I believe it gets pasted at the bottom of the code right before the ?> , please correct me if I'm wrong.

Someone did try to help me with this issue, but misunderstood what I wanted, and the code they edited removed any album views, it only showed catagories, and I had problems with being able to log in with their theme.php, I replaced it with the original, but in the attached zip you will see their version still there renamed to themeOLD.php.

Joachim Müller

Quote from: heartsy on November 27, 2007, 07:30:18 AM
Someone did try to help me with this issue
That someone was me.
Quote from: heartsy on November 27, 2007, 07:30:18 AMbut misunderstood what I wanted
No, I didn't misunderstand: you simply hijacked another thread that dealt with having a category list in three columns.
Quote from: heartsy on November 27, 2007, 07:30:18 AMand the code they edited removed any album views, it only showed catagories, and I had problems with being able to log in with their theme.php, I replaced it with the original, but in the attached zip you will see their version still there renamed to themeOLD.php.
That's all just nonsense, as I told you in the other thread as well. Don't blame others on your inability to describe what you want.

heartsy

I realize it was you that tried to help me, but in starting a new thread I didn't remember your nickname and of course it wasn't on the page where I was typing. Sorry for not stating your name.

I did not mean to hijack another thread, I was trying not to clutter the board with a question that kind of pertained to a subject already brought up. Sorry I didn't read the rules and realize that was a big no no, but as soon as I did, I tried to correct that by posting a new thread.

And the code does only show catagories, no albums...you don't get an album preview until after you click a catagory. And as far as the log in went, I'm not sure what went wrong, I renamed said themeOLD.php back to theme.php and now the log in is functioning properly, so that must have been some quirk in the system, my server or who knows. I apoligize for thinking it was the php file, whatever went wrong just happened at the same time I uploaded the new theme.

Now that's said, can we please start over and get back to the original question? How can I change my theme to display the catagories ***AND*** albums in vertical columns and not horizontal rows?


heartsy

#4
I read the docs.. and as you can see by this screen shot http://heartsy.com/albumlistconfig.jpg
my config is set up as it suggests in said link that you gave me.

Maybe I didn't make myself very clear in my earlier posts. I liked the basic preinstalled theme eyeball...only I wanted to change the colors to red instead of blue. I accomplished all this by editing the images in the image file and the font codes in the style sheet, I believe it was. I uploaded my changes into the same theme, yes I know you're not supposed to do that, but I renamed all the original files by adding OLD to them, thus preserving them if I ever needed to change back. So my color changes worked perfectly.

Then came the display problem, I would like the catagories and albums to view in column fashion vertically down my page. By defualt in the template they view horizontally acrossed my page. I found a thread, in searching before asking.. hoping to solve my problem without bothering anyone, where I believe you...Stramm posted a code for a person to use that would show catagories in columns, only this particular code does NOT show the album views as well.

Like an idiot I didn't fully read the rules, so I apparently, yet mistakenly posted on said thread, thus hijacking it, completely unintentionally. I thought it would be fairly simple to find out exactly where to paste said code into my gallery.. as that was not brought up, ie what page, and where in the code. And I also assumed that having the albums display along with the catagories was a simple on or off fix.. sorry I guess I was wrong.

Needless to say GauGau replied, and pasted this code

// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
        <tr>
                <td class="tableh1" width="25%"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="4%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="4%" align="center"><b>{PICTURES}</b></td>
        <td class="tableh1" width="26%"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="4%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="4%" align="center"><b>{PICTURES}</b></td>
        <td class="tableh1" width="25%"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="4%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="4%" align="center"><b>{PICTURES}</b></td>
        </tr>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
                <td class="catrow_noalb" colspan="3"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
                <td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>

<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="9" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;

function theme_display_cat_list($breadcrumb, &$cat_data, $statistics)
{
    global $template_cat_list, $lang_cat_list;
    if (count($cat_data) > 0) {
        starttable('100%');
        $template = template_extract_block($template_cat_list, 'header');
        $params = array('{CATEGORY}' => $lang_cat_list['category'],
            '{ALBUMS}' => $lang_cat_list['albums'],
            '{PICTURES}' => $lang_cat_list['pictures'],
            );
        echo template_eval($template, $params);
    }

    $template_noabl = template_extract_block($template_cat_list, 'catrow_noalb');
    $template = template_extract_block($template_cat_list, 'catrow');


    $count=0;
    $columnCount=3;
    echo "<tr>";

    foreach($cat_data as $category) {
    If ($count%$columnCount==0) {
        echo "</tr><tr>";
    }
        $count++;
        if (count($category) == 3) {
            $params = array('{CAT_TITLE}' => $category[0],
                    '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1]
                );
            echo template_eval($template_noabl, $params);
        } elseif (isset($category['cat_albums']) && ($category['cat_albums'] != '')) {
            $params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => $category['cat_albums'],
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
                );
            echo template_eval($template, $params);
        } else {
            $params = array('{CAT_TITLE}' => $category[0],
                '{CAT_THUMB}' => $category['cat_thumb'],
                '{CAT_DESC}' => $category[1],
                '{CAT_ALBUMS}' => '',
                '{ALB_COUNT}' => $category[2],
                '{PIC_COUNT}' => $category[3],
                );
            echo template_eval($template, $params);
        }
    }
  echo "</tr>";
    if ($statistics && count($cat_data) > 0) {
        $template = template_extract_block($template_cat_list, 'footer');
        $params = array('{STATISTICS}' => $statistics);
        echo template_eval($template, $params);
    }


    if (count($cat_data) > 0)
          endtable();
        echo template_extract_block($template_cat_list, 'spacer');
}


into my theme.php for me. So the results of that are as seen here http://heartsy.com/photos2.htm and unless you see something I don't... all that is showing is a list of catagories, NO albums listed under them. So this did correct part of my problem, yet still the question remains How do I get the Albums back on the page as well? As in this preview, which is how I want it to look... http://heartsy.com/photogallerysample.htm

I'm not sure what to do to bring back the album views, as I said the configuration settings thru admin are set to show them, but as you can see they don't show up.

In the .zip I attached with my earlier post that is the theme that GauGau edited, with one excpetion, his theme.php was renamed to themeOLD.php. As I explained for some reason and apparently just happened at the same time, but after uploading and appling that theme the log in fuction goofed. It was like a continual circle, said you got logged in, but returned you to gallery logged out. Like I said, apparently it was some fluke in my system, because later I renamed things back on my server, and the log in works fine again. As GauGau stated, his code didn't and shouldn't have caused any thing odd like that. And since I did nothing but rename, swap, rename and swap back, it must have been some kind of server issue? Whatever the case it's working now, and that is the gallery theme installed on site now. Just wanted to clarify the files inside the zip just incase anyone does decide to take a peek at them.

Joachim Müller

Attached screenshots instead of the made-up html that will no doubt go down sooner or later, rendering this thread useless. Edited your posting, adding the [ c o d e ] -bbcode-tag.
Frames suck. Not renaming your theme is ignorant. Quoting the code once more instead of just posting reference to the other thread is useless.

heartsy

thank you once again for correcting my errors, as I was not sure how to properly post the information myself.