Template Location for {GALLERY} or {CAT_ALBUMS}? Template Location for {GALLERY} or {CAT_ALBUMS}?
 

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

Template Location for {GALLERY} or {CAT_ALBUMS}?

Started by broig, February 16, 2009, 12:52:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

broig

Hey, my first post!  Nice to be here.

I've been working a bit on creating my own template, and
so far its been going pretty smooth...  most of the code
has been acceptably non-elusive to find, but as of yet I
still can't get ahold of where to find the part that controls
the HTML layout of {GALLERY} or {CAT_ALBUMS}.

So far, $template_cat_list is where the path has ended.
It begins with a table-row, so this tells me its a child
component of something...  I just have no idea where to
look.

SolidSnake2003

I believe its under the Theme.php file for the template

Joachim Müller

The {GALLERY}-token is a placeholder for the entire output. There's not a single variable that controls it. You might want to take a look at the preliminary docs for cpg1.5.x, they describe in more detail what the tokens mean and which token controls what. In your case, that's http://coppermine.svn.sourceforge.net/viewvc/coppermine/trunk/cpg1.5.x/docs/en/theme_template.htm#theme_template_token

Describe what you actually want to accomplish.

@SolidSnake2003: thanks for your readiness to help, but that's not correct.

broig

What I was attempting to describe was my inability
to find the layout code for how the categories and
albums appear.

I may have found the answer to my own question though.
Searching through the /sample/theme.php file I've come
across a function named 'theme_display_album_list()' which
apparently writes dynamic html to show the albums in the
browser window.

How this is accomplished is easy to read, but hard to understand.
There is a lack of comments in this area, so I guess for now I'm
limited to butting my head on it.  Perhaps I should just forgou this
whole thing until I'm out of newb status with PHP.

...

Joachim Müller

Quote from: broig on February 18, 2009, 05:40:09 AM
I may have found the answer to my own question though.
Searching through the /sample/theme.php file I've come
across a function named 'theme_display_album_list()' which
apparently writes dynamic html to show the albums in the
browser window.
Exactly.
Quote from: broig on February 18, 2009, 05:40:09 AM
How this is accomplished is easy to read, but hard to understand.
There is a lack of comments in this area, so I guess for now I'm
limited to butting my head on it.  Perhaps I should just forgou this
whole thing until I'm out of newb status with PHP.
That's fine by me, but you learn by asking questions and trying out things. Why don't you describe what you actually want to see changed layout-wise? Maybe we can come up with a solution for the benefit of all.

broig

Foremost what I am looking to accomplish is
transitioning away from the table layout in
favor of divs and img links. The following
is an example...

Before -

<tr class="tableb_compact">
<td width="34%" valign="top">

<table cellspacing="0" cellpadding="0" width="100%">

<tbody>
<tr>
<td height="1" valign="top" class="tableh2" colspan="3">
<span class="alblink"><a href="thumbnails.php?album=5"><b>Microstudy</b></a></span>
</td>
</tr>
<tr>
<td colspan="3">
<img height="1" border="0" width="1" alt="" src="images/spacer.gif"/><br/>
        </td>
</tr>
<tr>
<td align="center" valign="middle" class="thumbnails">
<img height="1" width="52" alt=""
style="border: medium none ; margin-top: 0px; margin-bottom: 0px;"
class="image"
src="images/spacer.gif"/><br/>
<a class="albums" href="thumbnails.php?album=5">
<img height="37" border="0" width="50" alt=""
class="image" src="images/thumb_nopic.jpg"/><br/>
</a>
</td>
<td>
<img height="1" border="0" width="1" alt=""
src="images/spacer.gif"/>
</td>
<td width="100%" valign="top" class="tableb_compact">
<table cellspacing="1" cellpadding="0" border="0">
<tbody>
<tr>
                        <td align="center" valign="middle" class="admin_menu">
<a onclick="return confirm('Are you sure you want to DELETE this album ? \nAll files and comments will also be deleted.');"
   class="adm_menu" href="delete.php?id=5&amp;what=album">DELETE</a>
                        </td>
                        <td align="center" valign="middle" class="admin_menu">
                                <a class="adm_menu" href="modifyalb.php?album=5">PROPERTIES</a>
                        </td>
                        <td align="center" valign="middle" class="admin_menu">
                                <a class="adm_menu" href="editpics.php?album=5">EDIT FILES</a>
                        </td>
</tr>
</tbody>
</table>

            <p class="album_stat">0 files</p>
        </td>
</tr>
</tbody>
</table>



After - lacking any fine-tune adjustments, but serves
to show the basic structure I'm looking for.

<div class="albumdiv"
     style="padding: 3px;
position: absolute;
background-color: rgb(64, 64, 64);
z-index: 5;
left: 400px;
top: 221px;"> // Besides positioning of course.
<span id="alblink"><a href="thumbnails.php?album=5"><b>Microstudy</b></a></span>

<div class="alb_tainer">
<a class="albums" href="thumbnails.php?album=5">
<img height="37" border="0" width="50" alt=""
class="image" src="images/thumb_nopic.jpg"/>
</a>
<p class="album_stat">0 files</p>
<div id="alb_utils">
<a onclick="return confirm('Are you sure you want to DELETE this album ? \nAll files and comments will also be deleted.');"
   class="adm_menu" href="delete.php?id=5&amp;what=album">DELETE</a>
<a class="adm_menu" href="modifyalb.php?album=5">PROPERTIES</a>
<a class="adm_menu" href="editpics.php?album=5">EDIT FILES</a>
</div>
</div>

</div>

Joachim Müller

Coppermine is table-driven beyond hope. The table'd code resides all over the core. Many have tried to come up with a table-less approach. I haven't seen anyone of the succeed. So the bottom line is: I strongly recommend not to waste your energy and skills on such a project; the complete core code would have to be overhauled (i.e. re-done) to accomplish what you're up to. This would require the modification of many thousand lines of code spread across dozens of files. Even shorter answer: forget about it.

smellybeard

It occurs to me that it might be better to write an entirely separate presentation application and use the existing coppermine purely as a gallery management tool. For a single site one could use fairly terse 'once only' throw away code.