Simple Theme [g1]

paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2005-08-31 09:29

Hi,

I made a simple theme for G2, which I called G1, because it is simple and kind of reminiscent of G1 in that there is no sidebar and the top of the page is relatively uncluttered.

It works well in modern browsers, but it will need help before it works on the likes of IE 6. Feel free to modify it and post it back here. It is public domain.

AttachmentSize
g1.zip96.34 KB
 
damnsaint
damnsaint's picture

Joined: 2005-10-02
Posts: 4
Posted: Sun, 2005-10-02 01:47

I am using the latest g2 installation (unpossible)... I installed your theme. It works well on the front end, but now I can't access the site admin! I don't know what to do now. Any suggestions? I need to get there, or I'm in trouble. PLEASE HELP

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-10-02 15:17

You should still have a Site Admin link in the upper-right corner of your pages. Do you get any error message?

FAQ: What information is required when I ask for help in the forums?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
damnsaint
damnsaint's picture

Joined: 2005-10-02
Posts: 4
Posted: Sun, 2005-10-02 23:29

I have the link but after clicking, my page shows no admin options whatsoever! Crazy. I have several gallery installs and tweaked with a lot and I've never seen such a thing. I just want to get back to the admin and dump this theme. The site is
http://brownfilms.com

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-10-02 23:48

I see you're using an extremely old version of G2, pre B4, probably some nightly shortly after they added the new theme system in. Please upgrade to G2 final release. Backup your data, db and install first!

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
damnsaint
damnsaint's picture

Joined: 2005-10-02
Posts: 4
Posted: Sun, 2005-10-02 23:55

Is there a streamlined way to backup the gallery and then reupload after an update?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2005-10-03 01:20

Streamlined? Sot really. Here's what you need to backup. FAQ: How do I backup G2?

If all goes smoothly, as it should, you won't need to restore any files. The backup is just a precaution.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
kzo

Joined: 2004-02-02
Posts: 9
Posted: Sun, 2005-12-25 09:15

thank you, a theme that doesn't suck.

 
rick7

Joined: 2005-03-02
Posts: 168
Posted: Mon, 2005-12-26 18:52

Hi Paour -- Thank you IMMENSELY for this G1 theme which I just installed. I really do prefer G1's interface of NOT having a sidebar which in my view clutters things up too much.

I wonder if you might add a configuration option for choosing the default <<item action>> for a photo page. It's currently 'View Slideshow' but I'd prefer it to be 'Add Comment'. My users love to Add Comments but I'm afraid they won't know to click the <<item action>> dropdown to do so. (By the way, I like your style of placing a default item to the left of the dropdown rather than having the dropdown be 'open' which again can clutter things up.)

Thanks much for all your work.

Gallery version = 2.0.2 core 1.0.0.2
PHP version = 4.4.2-dev apache
Webserver = Apache/1.3.34 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.4.2-dev FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7g
Database = mysql 4.0.25-standard
Toolkits = ArchiveUpload, Exif, ImageMagick, NetPBM, Gd
Operating system = Linux tnx.opensourcehost.com 2.6.14.2-ts.grl.mh.ht #1 SMP Mon Nov 14 00:12:50 EST 2005 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Sun, 2006-01-08 11:48

Updated version, compatible with G2.1.

--
Gallery Remote developer

 
rick7

Joined: 2005-03-02
Posts: 168
Posted: Tue, 2006-01-10 00:06

Hi Paour -- did you mean that you have a version of the G1 theme that will be compatible with a future G2.1 but not with the current 2.0.2? Thanks much for your help.

 
gmoe

Joined: 2003-12-05
Posts: 5
Posted: Tue, 2006-01-10 04:22

awesome theme! I just switched my gallery over to it. This looks ideal for embedding into another page as well..

http://moe-online.us

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2006-01-10 07:52

rick7: yes, starting today the daily snapshots and the code in CVS can be considered 2.1 betas and use a different API, which makes it necessary to update themes and modules.

gmoe: thanks for the praise. Let me know if you fix issues with it.

--
Gallery Remote developer

 
rick7

Joined: 2005-03-02
Posts: 168
Posted: Tue, 2006-01-10 10:41

Thanks, Paour. I'm wondering if this new version addresses my 12/26 note above: a configuration option for choosing the link on the photo page that appears to the left of the <<item action>> dropdown in the upper right. It's currently 'View Slideshow' but I'd like to set it to 'Add Comment'. Thanks.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2006-01-10 10:52

rick7: it doesn't, sorry. You can edit the theme file yourself (it should be easy). If I get some time, I may make this configurable, but don't hold your breath...

--
Gallery Remote developer

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Fri, 2006-01-13 05:39

I'm trying to install this in my gallery, and it's giving me a problem when I go to set it as the default. At the top of the page it gives me this message
"Warning: Invalid argument supplied for foreach() in opt/lampp/htdocs/gallery/modules/core/classes/GalleryTheme.class on line 730" (http://img66.imageshack.us/img66/5223/g19da.jpg)
That error stays in the header, and it doesn't seem to change from the 'classic' theme that I am using in the interrim. The text size is also about size 24 font on everything. Any ideas?

Here's my specs if it's helpful:

Quote:
Last Run Details:

Gallery version = 2.0.2 core 1.0.0.2
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/5.0.4 DAV/2 mod_perl/2.0.1 Perl/v5.8.7
Database = mysql 4.1.13
Toolkits = ArchiveUpload, Exif, Ffmpeg, ImageMagick, NetPBM
Operating system = Linux ubuntu 2.6.12-10-386 #1 Thu Dec 22 11:37:10 UTC 2005 i686
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

http://usacomp.zapto.org/gallery/main.php Is my site if that helps.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2006-01-13 07:57

Can you post the couple of lines before and after 730 in that file on your system?

--
Gallery Remote developer

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Fri, 2006-01-13 08:11

Yeah, no problem. 730 bolded

/* Unserialize our blocks and preload them if necessary */
	$platform = $gallery->getPlatform();
	$g2Base = dirname(dirname(dirname(dirname(__FILE__))));

	list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module');
	if ($ret->isError()) {
	    return array($ret->wrap(__FILE__, __LINE__), null);
	}

	foreach (array('sidebarBlocks', 'albumBlocks', 'photoBlocks') as $blockKey) {
	    if (!isset($theme['params'][$blockKey])) {
		continue;
	    }

	    $theme['params'][$blockKey] = unserialize($theme['params'][$blockKey]);

	    $seen = array();
	    foreach ($theme['params'][$blockKey] as $block) {
		$seen[$block[0]][] = $block[1];
	    }

	    foreach ($seen as $key => $blockParams) {
		list ($module, $file) = explode('.', $key);

		if (empty($pluginStatus[$module]['active'])) {
		    continue;
		}

		$path = "modules/$module/Preloads.inc";
		if ($platform->file_exists("$g2Base/$path")) {
		    GalleryCoreApi::relativeRequireOnce($path);
		    $className = "${module}Preloads";
		    $instance = new $className;
		    $ret = $instance->preload($template, $file, $blockParams);
		    if ($ret->isError()) {
			return array($ret->wrap(__FILE__, __LINE__), null);
		    }
		}
	    }
	}
 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2006-01-13 08:39

I guess you can surround this foreach with an !empty test:

if (!empty($theme['params'][$blockKey])) {
  foreach ($theme['params'][$blockKey] as $block) {
    $seen[$block[0]][] = $block[1];
  }
}

--
Gallery Remote developer

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Fri, 2006-01-13 12:56

Well, that seemed to work at first, then it gave me this error (same style and location): "Warning: Division by zero in /opt/lampp/htdocs/gallery/themes/g1/theme.inc on line 107"

	/* Add in our extra stuff */
	$theme =& $template->getVariableByReference('theme');
	$theme['columnWidthPct'] = floor(100 / $params['columns']);

Also giving me this error in the footer, repeated (ie http://img78.imageshack.us/img78/3179/g1s8do.jpg):
"Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/gallery/modules/core/Callbacks.inc on line 62"

	case 'ShouldShowEmergencyEditItemLink':
	    $block['core']['ShouldShowEmergencyEditItemLink'] = false;
	    if (isset($params['permissions']['core_edit'])) {
		$block['core']['ShouldShowEmergencyEditItemLink'] = true;
		foreach (array('checkSidebarBlocks' => 'sidebarBlocks',
			       'checkAlbumBlocks' => 'albumBlocks',
			       'checkPhotoBlocks' => 'photoBlocks')
			as $key => $value) {
		    if (!empty($params[$key])) {
			foreach ($theme['params'][$value] as $entry) {
			    if ($entry[0] == 'core.ItemLinks') {
				$block['core']['ShouldShowEmergencyEditItemLink'] = false;
				break 2;
			    }
			}
		    }
		}
	    }
	    return GalleryStatus::success();

Thank you so very much for your assistance in this.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2006-01-13 13:29

I think something is wrong with the theme data. Could you disable, then uninstall the theme, then reinstall and enable it again?

--
Gallery Remote developer

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Fri, 2006-01-13 13:37

Yeah, I can do that. Gotta run to the bookstore and get some of my books for the semester, so it might be a little later today.

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Fri, 2006-01-13 13:50

Actually I found a spot of time around my morning coffee, so I went ahead and did that, and it now appears to be working. The only problem is that the "Warning: Invalid argument supplied for foreach() in /opt/lampp/htdocs/gallery/modules/core/Callbacks.inc on line 62" is still there as before.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2006-01-13 14:26

usacomp2k3: can you change the lineif (!empty($params[$key])) { to if (!empty($params[$key]) && !empty($theme['params'][$value])) {

--
Gallery Remote developer

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Fri, 2006-01-13 14:30

That appears to have done the trick. Thank you very much. I love the theme and am glad to be able to use it, now that it's working 8)

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Fri, 2006-01-13 14:44

Glad this fixed the problem. I don't really know what caused this behavior, but slightly more robust code always helps.

--
Gallery Remote developer

 
smsa

Joined: 2005-02-22
Posts: 6
Posted: Sat, 2006-01-14 17:39

I had exactly the same problem.
To sum up how to fix it:
First edit gallery/modules/core/classes/GalleryTheme.class on line 730

   foreach ($theme['params'][$blockKey] as $block) {
      $seen[$block[0]][] = $block[1];
   }

to

if (!empty($theme['params'][$blockKey])) {
  foreach ($theme['params'][$blockKey] as $block) {
    $seen[$block[0]][] = $block[1];
  }
}

Then edit gallery/modules/core/Callbacks.inc on line 62
if (!empty($params[$key])) {
to
if (!empty($params[$key]) && !empty($theme['params'][$value])) {

 
diedvdyk

Joined: 2003-01-05
Posts: 6
Posted: Sat, 2006-01-14 21:32

I don't see a link to download the g2.1 version of the g1 theme.
The theme workes with core api 7.1 and the thema api 2.2 ?

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Sun, 2006-01-15 15:50

diedvdyk: for some reason the file was no longer showing. It's again available here: http://gallery.menalto.com/node/35498#comment-161035

--
Gallery Remote developer

 
corvi_yallis

Joined: 2006-01-23
Posts: 9
Posted: Sun, 2006-01-29 18:06

How do I make the top gallery to list 1 album thumbnail per row just like the demo page (http://www.paour.com/gallery2/v/photolog) but the albums/sub-albums below are in matrix thumbnail view ?

When I tried to install your theme, the top gallery are viewed in matrix style.

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Mon, 2006-01-30 01:08

If you click on edit from the top gallery, and then the theme tab, you should be able to define one row, and then have it just not apply changes to folders beneath it.

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Mon, 2006-01-30 01:08

If you click on edit from the top gallery, and then the theme tab, you should be able to define one row, and then have it just not apply changes to folders beneath it.

 
Npollock

Joined: 2006-01-30
Posts: 1
Posted: Mon, 2006-01-30 17:37

For some reason, I can't get the information to go to the right side of the image on the images in the g1 theme.

I am on v2.02 of gallery and really wanted the old g1 format back. I unziped the g1 into the themes directory and installed it. When I select it though, all of the album information goes under the image, not to the right. So I selected all of the options and said to put them on the sidebar, but there is no change. No matter what I select in blocks to show in sidebar, nothing changes on the screen. I have tried selecting all to sidebar and none to sidebar. I have used IE6, Firefox, flushed my cache files, etc, but I cannot get the information to display to the right of the image. I uninstalled g1 and re-installed it also, but no affect.

You can see what I mean at www.pollock-family.org/gallery2.

Any ideas on what I can try?

TIA

Norm

 
rick7

Joined: 2005-03-02
Posts: 168
Posted: Mon, 2006-01-30 23:06

NPollock -- I'm with you. It was very hard to see that with the arrival of G2 the G1 look was gone which I and many of my viewers loved. After a couple of months with G2 I've eventually learned to genuine appreciate other themes (I think Hybrid is fantastic), but in my heart whenever I see an old G1 album I feel a certain longing for the good ol' days. If I knew more programming, I'd create a theme that looked like the original G1.

From what I've discovered during my experimentations, using the G1 theme as your top-level theme doesn't really give you the G1 top-level look. As you say, the album text displays below the highlight, not at all like the original G1 which has it on the right. If you're making these changes at the top-level album (Gallery's main page), I don't think setting the sidebar options has any effect (though I'm not sure about this). Try using the Classic theme instead. It's actually more similar to the G1 top-level album look, with the summary text on the right. But you still see some things that are unfamiliar, such as the <<album actions>> dropdown, the frame around the highlight, etc.

And whereas with the real G1 you could have a long album summary to the right on that main page, in G2's Classic theme you're limited to 252 characters or something like that. (Though you can have a longer album description on the actual album page.)

I also kind of miss the original Gallery 1.4 green color, which I don't see available in any of the G2 themes.

Yep, these are all painful changes...

 
corvi_yallis

Joined: 2006-01-23
Posts: 9
Posted: Tue, 2006-01-31 01:46
usacomp2k3 wrote:
If you click on edit from the top gallery, and then the theme tab, you should be able to define one row, and then have it just not apply changes to folders beneath it.

Is it possible to do this programmatically. Something like:

if (top gallery) do this
else do that

 
tlingit54

Joined: 2004-12-31
Posts: 7
Posted: Tue, 2006-01-31 05:30

I really like this theme! It's just what I have been looking for. One thing: What file/line do I need to edit if I don't want the "View Slideshow" link? It is there whether or not I activate the Slideshow/Slideshow Applet module.

Thank you so much!

I'm using Gallery 2.0.2

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Tue, 2006-01-31 06:30

tlingit54: you can edit the g1/templates/photo.tpl and g1/templates/album.tpl.

Is anyone interested in collaborating to make the theme more customizable?

--
Gallery Remote developer

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Tue, 2006-01-31 07:28

I would, except I know nothing about programming, sorry (nor would I have much time to dedicate to it).

 
usacomp2k3
usacomp2k3's picture

Joined: 2005-09-25
Posts: 19
Posted: Thu, 2006-04-06 03:33

I just upgraded to 2.1, and the theme won't let me run

Quote:
A minimalist look and feel, close to G1
Incompatible theme!
Core API Required: 6.0 (available: 7.2)
Theme API Required: 2.1 (available: 2.3)

Any ideas?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-04-09 04:28

the 2.1 compatible version is attached above..

 
csalib

Joined: 2006-04-25
Posts: 11
Posted: Tue, 2006-04-25 21:58

Great theme! Has this issue been addressed in the latest?

http://gallery.menalto.com/node/36803?highlight=GalleryTheme.class%2Con%2Cline%2C747

 
rick7

Joined: 2005-03-02
Posts: 168
Posted: Wed, 2006-04-26 14:54

Paour -- a few months ago you asked if anyone is interested in collaborating to make the theme more customizable. I would love to, but I know nothing about Smarty programming. I'm a moderate-level SQL programmer and might be able to pick it up. Could I create the time to do it? Not sure, but possibly. The interest is there; I love a lot of G2 but genuinely miss the display that we had in G1. And I have a few more ideas for G1 that I like to see implemented.

One thing that's been on my mind: an option to NOT display the Date: and Views: under each photo on the album page.

Let's talk.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2006-04-26 15:12

rick7, I'd gladly welcome changes you make to the theme. You have all the pieces in the zip. Feel free to submit patches to me via this thread.

--
Gallery Remote developer

 
nmphoto

Joined: 2006-04-27
Posts: 4
Posted: Thu, 2006-04-27 07:18

How do I get the theme to look like yours where the sub-albums are listed?

Mine: http://nmphotonet.temp.powweb.com/gallery
Yours: http://www.paour.com/gallery2/v/photolog

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2006-04-27 07:22

That album on my Gallery is using the Classic theme now. I'll update the demo URL, thanks for pointing it out...

--
Gallery Remote developer

 
nmphoto

Joined: 2006-04-27
Posts: 4
Posted: Thu, 2006-04-27 07:26

that is the classic theme? how do i get the subalbums to show like that?

 
nmphoto

Joined: 2006-04-27
Posts: 4
Posted: Thu, 2006-04-27 07:29

Ah, I see what you mean. Is it hard to get the simplicity of your theme with the album formatting of the Classic theme and merge the two?

An example is my friends Gallery1 theme... http://imagesbyk2.com/gallery/

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2006-04-27 07:42

It's not too hard to modify the Classic theme to look like the G1 theme. The reverse would mean adding some of Classic's logic to G1, making it like a super-theme, which is not what the G2 theme intends.

--
Gallery Remote developer

 
nmphoto

Joined: 2006-04-27
Posts: 4
Posted: Thu, 2006-04-27 07:53

So in a sense, take the Classic theme and delete all the "rubbish"?

 
rick7

Joined: 2005-03-02
Posts: 168
Posted: Sun, 2006-04-30 02:20

Can someone suggest how to remove the 'Make Highlight' option that I see is now available beneath each thumbnail? Thanks.