Features other than pictures using G2?

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2006-12-31 05:35

Edit album, theme tab, 'Blocks to show in the sidebar' add the html block. Once you add it it will add a link called 'My Page'
on the sidebar. Remember you can reorder the items on the sidebar.

Then you will have to MANUALY edit the .tpl files that came with the module to the way you would like.
the link 'My page' is controlled with module/html/templates/blocks/HtmlBlock.tpl
the My Page page is controlled with modules/html/templates/HtmlPage.tpl

I have created a skeleton page on the codex so others that have used it more than me can update the page:
http://codex.gallery2.org/index.php/Gallery2:Modules:html

Dave
____________________________________________________
Blog with G2 || G2 theme contest: $3K in Prizes

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2007-01-04 22:18
GusDoeMatik wrote:
Personally I think that that the Html module should be written with at least 2 static pages instead of 1 so simpletons, like me, ....

I have updated the module to have 3 pages.
It works on G2.1.1 and G2.2
http://gallery.menalto.com/node/28570?page=2#comment-228795
I will work on the codex as well.
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Tue, 2007-01-23 14:03

Excuse for my bad english.
Two questions.
-Can i view "My page"- My content section in the whole page, without sidebar section in the left (Go to: << Back) ?
-can i add "My page" link in the top right links area ?

I used pgtheme

Versione di Gallery = 2.1.2 core 1.1.0.2
Versione PHP = 4.4.2 apache
Webserver = Apache/1.3.34 (Unix) mod_ssl/2.8.25 OpenSSL/0.9.7f PHP/4.4.2 mod_perl/1.29 FrontPage/5.0.2.2510 mod_jk/1.2.18
Database = mysql 4.1.12-standard-log, lock.system=flock
Strumenti = ArchiveUpload, Exif, Getid3, ImageMagick, NetPBM, Ffmpeg, Thumbnail, Gd
Accelerazione = none, none
Sistema operativo = Linux roar.netjaguar.com 2.6.8-022stab070.5-entnosplit #1 SMP Tue Apr 4 23:10:45 MSD 2006 i686
Tema predefinito = PGtheme
Locale = it_IT
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7

 
brianb_adk

Joined: 2006-11-09
Posts: 48
Posted: Wed, 2007-03-07 02:00

So what about doing more than just adding the same link to each page? What if I want each photo to have a different link to a separate page, or for each photo page to have a couple of different selections for purchasing and checking out?

I'm not seeing much on this module out there - is there something else that will let you customize each photo page with html?

 
Likely

Joined: 2006-06-11
Posts: 8
Posted: Wed, 2007-03-14 04:07

Great module but it only wants to work on one install of G2.2rc2 when I've tried it on 2 seperate servers:

Works perfectly on:

Gallery version = 2.2-rc-2 core 1.1.30
PHP version = 4.4.4 cgi
Webserver = Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635.SR1.2 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b
Database = mysqlt 4.1.21-standard, lock.system=flock
Acceleration = partial/900, full/900
Operating system = Linux sh120.surpasshosting.com 2.6.19.2-grsec-Opteron-DSE-M #2 SMP Sat Jan 20 01:01:30 EST 2007 x86_64
Default theme = copyleft
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.7) Gecko/20060911 Camino/1.0.3
____

Doesn't work on:
____

Gallery version = 2.2-rc-2 core 1.1.30
PHP version = 5.0.4 apache2handler
Webserver = Apache/2.0.52 (Red Hat)
Database = mysqli 4.1.20, lock.system=flock
Acceleration = partial/900, full/900
Operating system = Linux Tina.netpivotal.com 2.6.9-42.0.3.ELsmp #1 SMP Mon Sep 25 17:28:02 EDT 2006 i686
Default theme = copyleft
Locale = en_GB
Browser = Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.0.7) Gecko/20060911 Camino/1.0.3
____

The sites (g2) are mirrored and this is the only module that doesn't work, it installs fine and shows up in plugins and in themes and seems to activate when added to sideblock but just doesn't show up, (fyi: I've deleted/reset all the cache things, several times and the only slight difference is that on the one it works on I've got * Custom Fields * EXIF/IPTC modules installed), any ideas ?

Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2007-03-14 04:58

Could be a php version issue as well. I will not be able to test that part.
On the one that does not work can you enable buffered debug and see if there is some thing to give a hint.

What do you mean by "mirrored"?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2007-03-14 12:18

i didn't read the whole discussion, just noticed php 5.0.4. please upgrade to php 5.2.1 (or at least php 5.1.2). the php 5.0.x versions were too buggy.

--------------
Doumentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
Likely

Joined: 2006-06-11
Posts: 8
Posted: Wed, 2007-03-14 15:35

Thanks for the prompt responses, it's appreciated.

Hi Dave, I mean that both the servers have an identical install of g2, one for back up and testing of settings and modules ;) (The one it works on), I've now installed both the * Custom Fields * EXIF/IPTC modules in the one that doesn't work just to make sure and made no difference.

As yourself and valiant both indicated that it could be a PHP issue I've requested that it (5.0.4) be updated, as the Gallery isn't live yet it's not that important but is still an issue, we'll see how the request goes.

Many thanks again, I'll update the thread when I get more news/info.

Leon

[Edit] It seems that at the moment they can only update to 5.1.6, (through 'yum' ? as that's all it's showing.), I'll report any changes if any.

 
Likely

Joined: 2006-06-11
Posts: 8
Posted: Fri, 2007-03-16 16:19

Strange!, just started working all of a sudden, the only problem now is that, it shows up in the sideblock but in:

Safari 1.3.2 (v312.6): Says it can't load page as it contains no data.
Firefox 1.5.0.10: Wants to download a php page.
Camino 1.0.3: Just downloads a php page.

Thanks

Leon

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2007-04-02 01:19

Updated module to have URL rewite as well as 3 pages.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Liquid_Squelch

Joined: 2006-09-10
Posts: 15
Posted: Sat, 2007-05-19 20:38

Is there any way to modify the template, so that there is a link icon to the left of each link?
I'm looking to make it look seemless with my sidebar
Thanks

 
Woody69

Joined: 2007-07-30
Posts: 2
Posted: Mon, 2007-08-06 16:57

Is there a way to pass the photo name from the Photo.tpl page to the Html page? Ideally I would like to be able to use the photo name and the image in a form and then passed to a perl script.

Maybe a bit more background would be helpful, we are custom printers ... printing window graphics to the clients size as they request. When they want to use one of our images, it is helpful to show them what the image would look like distorted to their dimensions. So for example if they have a sidelight thats 8" wide and 56" tall the image would distort to that (From there if it does not work for them we can custom edit the image to work for their needs, or let them choose another image.)

I have provided a link to what we are currently using, but would love to get Gallery2 to do the same

http://www.two-partners-and-a-dream.com/cgi-bin/arcadia301/gallery.cgi?func=show&file=209268&Category=100111&Page=1

Thanks

 
Woody69

Joined: 2007-07-30
Posts: 2
Posted: Thu, 2007-08-09 23:45

OK I'm working on building a module ... its slow work seeing as I have to learn PHP, Smarty, and the code for Gallery2 But its started.

I'm thinking that I can use some of the code from Cart, ECard, and the Photo.tpl to get what I need to get done.

Anybody know where to get a question answered?

Well I'm working on that too.

 
lightpainter

Joined: 2005-11-25
Posts: 64
Posted: Sun, 2007-11-18 02:55

I've got this working, thanks for the module. I am having problems formatting the pages though- almost any HTML formatting in the body of the page results in a blank page being rendered. If I insert a CSS style as follows

}
.htmlPage{
font-family: Papyrus, Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
color: #FF7F50;
}

in the theme.css for my theme (X_treme), and refer to that in the HTML page, I can get the font style and colour to display, but for the life of me I cannot change the font size. I've tried various things with the very useful Firefox Webdeveloper plugin, as well as real code uploads, but something is overriding the size style, which I thought was against the principle of CSS?

Any suggestions how to get round this will be very welcome- my writing is coming out so small it is almost unreadable!

Thanks,

Tom
-----------------------------
www.lightpainter.co.uk

 
lightpainter

Joined: 2005-11-25
Posts: 64
Posted: Fri, 2007-11-23 17:17

OK, I found the answer elsewhere: http://gallery.menalto.com/node/63885
-----------------------------
www.lightpainter.co.uk

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 421
Posted: Thu, 2008-01-03 22:08
floridave wrote:
Updated module to have URL rewite as well as 3 pages.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Thanks for this!

But in admincp, i don't see the block named: HTML

But i can set it show on my leftbar.

How to edit content and title?

http://www.carondesktop.com/index.php?g2_view=html.HtmlPage&g2_fromNavId=xeb7b2fbf

Thanks!

Exotic Car Wallpaper - Celebrity Wallpaper

 
FlexibleInternet

Joined: 2007-01-25
Posts: 4
Posted: Thu, 2008-01-10 11:50

bigu_c
To change what appears in the sidebar, create a new directory called local in html/templates/blocks and copy HtmlBlock.tpl to that directory. Then edit HtmlBlock.tpl in the local directory. For example:

<div class="{$class}">
  <h3> {g->text text="Information"} </h3>
  <ul>
    <li>
      <a href="{g->url arg1="view=html.HtmlPage"}"> {g->text text="Terms & Conditions"} </a>
    </li>
    <li>
      <a href="{g->url arg1="view=html.HtmlPage2"}"> {g->text text="Other sites of interest"} </a>
    </li>
    <li>
      <a href="{g->url arg1="view=html.HtmlPage3"}"> {g->text text="Contact Me"} </a>
    </li>   
  </ul>
</div>

To change what appears in the html pages, create a new directory called local in html/templates and copy HtmlPage.tpl, HtmlPage2.tpl and HtmlPage3.tpl to that directory. Then edit the HtmlPage.tpl, HtmlPage2.tpl and HtmlPage3.tpl files in the local directory.
For example:

<div class="gbBlock gcBackground1">
  <h2>
    {g->text text="Terms and Conditions"}
  </h2>
</div>

<div class="gbBlock">
  <p class="giDescription">
    {g->text text="These are my terms and conditions. <br>
This appears on a new line. <br>
So does this.<br>"}
  </p>
</div>

After you make the changes go to Maintenance in the admin cp and run Delete template cache and Delete User Sessions to make the changes visible to everyone.
Hope this helps.

 
jojomart

Joined: 2008-01-15
Posts: 26
Posted: Thu, 2008-01-17 03:57

OK, so I figured out that if you remove the "'s after the text= and before the last curl ex:

{g->text text="These are my terms and conditions. <br>
This appears on a new line. <br>
So does this.<br>"}

the page won't show up.

Now what I want to do with the html module (besides Terms of Use) is make three pages:

1) Contact Us page (I have a script to use)
2) Error Page (if they didn't fill in what's required)
3) A Thank You page upon submission

I've made 4 html templates, and inserted the text I want, but my contact.php script requires me to fill in a link to the error and thank you pages. This is where I'm stuck! I have no clue where to send the script. Can someone please fill me in on what the correct url would be?

Here's the script, so you can see what I mean:


<?php
// Website Contact Form Generator 
// http://www.tele-pro.co.uk/scripts/contact_form/ 
// This script is free to use as long as you  
// retain the credit link  

// get posted data into local variables
$EmailFrom = "admin@wallpaper-downloads.info";
$EmailTo = "admin@wallpaper-downloads.info";
$Subject = "Wallpaper Downloads Feedback Form";
$Name = Trim($_POST[Name]); 
$EmailAddress = Trim($_POST[EmailAddress]); 
$QuestionsorComments = Trim($_POST[QuestionsorComments]); 

// validation
$validationOK=true;
if (Trim($Name)=="") $validationOK=false;
if (Trim($EmailAddress)=="") $validationOK=false;
if (Trim($QuestionsorComments)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;http://www.wallpaper-downloads.info/htmlpage3.html\">";
  exit;
}

// prepare email body text
$Body .= "Name: ";
$Body .= "$Name";
$Body .= "\n";
$Body .= "EmailAddress: ";
$Body .= "$EmailAddress";
$Body .= "\n";
$Body .= "QuestionsorComments: ";
$Body .= "$QuestionsorComments";
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;http://www.wallpaper-downloads.info/htmlpage4.html\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;http://www.wallpaper-downloads.info/htmlpage3.html\">";
}
?>

It's the items in bold that I need to know - I doubt that what I've got there now is correct.

Blessings,
Joanne

 
jojomart

Joined: 2008-01-15
Posts: 26
Posted: Thu, 2008-01-17 13:38

Another problem with this mod - every time I use url rewrite on the pages, my pictures disappear! Any idea why this is?

Thanks!

Joanne

 
Likely

Joined: 2006-06-11
Posts: 8
Posted: Thu, 2008-11-13 01:51
Liquid_Squelch wrote:
Is there any way to modify the template, so that there is a link icon to the left of each link?
I'm looking to make it look seemless with my sidebar
Thanks

A little late I know but as I've been updating my theme:

The quick and dirty way is to edit/add in the 'Htmlblock.tpl' in bold

Quote:
<li>
<img src="{g->url href="/gallery2/themes/copyleft/images/htmlinfo2.gif"}" width="20" height="16" alt="htmlinfo"/><a href="{g->url arg1="view=html.HtmlPage"}"> {g->text text="Photographers"} </a>
</li>

[img]http://www.eyephotography.co.uk/g2forumimgs/htmlicontest.jpg[/img]

There is a more subtle way with css but will update when finished my own.

Whilst I'm here, I also got the style to fit with my current theme by copying:

Quote:
<table width="100%" cellspacing="0" cellpadding="0">
<tr valign="top">
<td>
<div id="gsContent" class="gcBorder1">
<div class="gbBlock gcBackground1">
<table style="width: 100%">
<tr>
<td>
{if !empty($theme.item.title)}
<h2> {g->text text="Licensing"} </h2>
{/if}
{if !empty($theme.item.description)}
<p class="giDescription">
{g->text text="Using images from Eye Photography"}
</p>
{/if}
</td>
<td style="width: 15%">
{g->block type="core.ItemInfo"
item=$theme.item
showDate=true
showSize=true
showOwner=false
class="giInfo"}
</td>
</tr>
</table>
</div>
</div>

From line 7 to 39 and deleting lines:

9 {if !empty($theme.params.sidebarBlocks)}
10 <td id="gsSidebarCol">
11 {g->theme include="sidebar.tpl"}
12 </td>
13 {/if}

from the 'album.tpl' of the theme, into the 'HtmlPage.tpl' there's a little cleaning up to do but it works.

[img]http://www.eyephotography.co.uk/g2forumimgs/Librarysnip.jpg[/img]
[img]http://www.eyephotography.co.uk/g2forumimgs/Licensingsnip.jpg[/img]

Just got some css to do to finish off.

Q: The only thing that's missing/not working is the pages don't show up in the breadcrumb ? any ideas !!!

Nice to see it working with 2.2.4.

Testing on local install with Mamp.

Leon

 
Likely

Joined: 2006-06-11
Posts: 8
Posted: Thu, 2008-11-13 01:54

Just to tidy things up if your using the quick and dirty way from above:

Quote:
Add:

.htmlBlock img {
vertical-align: middle;
}

to your theme css:

Then add:

<div class="gbBlock htmlBlock">

To the HtmlBlock.tpl

and you end up with:

[img]http://www.eyephotography.co.uk/g2forumimgs/htmlicontest2.jpg[/img]

 
user52839307
user52839307's picture

Joined: 2008-03-25
Posts: 2
Posted: Tue, 2008-03-25 17:04

Graat Mod. Just what I was looking for.

Is there any way to get my pages to ad a link to the breadcrumb trail?

Thanks.

 
Likely

Joined: 2006-06-11
Posts: 8
Posted: Thu, 2008-03-27 15:14
Quote:
^ Been wondering the same myself, I thought I saw mention of it already working with breadcrumbs but it never has ?

[Edit 27.03.08] There really was a comment above mine yesterday mentioning 'Breadcrumbs' honest I'm not talking to myself! am I ?

 
user52839307
user52839307's picture

Joined: 2008-03-25
Posts: 2
Posted: Fri, 2008-03-28 03:53

Ok, I don't know much about the functions or syntax used by Gallery yet so I worked out a "cheap hack" using javascript. If somebody could provide a more conventional way it would be great.

To ad a link to the breadcrumb trail...

First, as usual, I made a copy of the BreadCrumb.tpl file and placed it into an adjacent "local" folder. I then added an "id" attribute to the "div" tag on line 13 like this.

before: <div class="{$class}">
after: <div id="BreadCrumbs" class="{$class}">

This way I could reference the contents of the div element by using javascript like this.

document.getElementById('BreadCrumbs').innerHTML

I put this script into the MyPage.tpl like this.

<script type="text/javascript">
<!--
  document.getElementById('BreadCrumbs').innerHTML += '<span class="BreadCrumb-2">My Page</span>';
// -->
</script>

This will add a no-link item to the end of the breadcrumb trail.

to ad a link item use this.

<script type="text/javascript">
<!--
  document.getElementById('BreadCrumbs').innerHTML += '<a href="{g->url arg1="view=html.HtmlPage"}"> {g->text text="My Page"} </a>';
// -->
</script>

use += to append to end. or use just = to replace the whole line.
Use <span class="BreadCrumb-1"> for root item.
Use <span class="BreadCrumb-2"> for no-link items.

Again I would like very much to know how to add items to the breadcrumb trail by using a gallery function. If anybody could provide a code snippet and explaination I would greatly appreciate it.

Thanks,

Saeros

 
Alexandra70

Joined: 2004-12-08
Posts: 143
Posted: Tue, 2008-05-06 01:15

Ok... I cannot figure out this problem... even though I looked at every single file several times.

All I am trying to do is rename "HtmlPage" to something else... Actually to "UsefulInfo"

So I edited all files that had the word "HtmlPage" to "UsefulInfo"... (file names AND also inside those files)

And this is what I get when I click on the "Useful Info" link on the sidebar...


Security Violation

The action you attempted is not permitted.

Back to the Gallery
Error Detail -
Error (ERROR_BAD_PARAMETER) : Class UsefulInfoView not defined in html.UsefulInfo

    * in modules/core/classes/GalleryView.class at line 194 (gallerycoreapi::error)
    * in main.php at line 318 (galleryview::loadview)
    * in main.php at line 94
    * in main.php at line 83

System Information
Gallery version 	2.2.4
PHP version 	4.4.8 apache
Webserver 	Apache/1.3.41 (Unix) PHP/4.4.8 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a
Database 	mysqlt 4.1.22-standard
Toolkits 	ImageMagick, Thumbnail, NetPBM, Gd
Operating system 	Linux poplar.vosn.net 2.6.23.12-ts.grh.mh.i386-vmsp #5 SMP Mon Feb 11 00:07:37 EST 2008 i686
Browser 	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

What am I doing wrong??

I also want later, to rename "HtmlPage2" and "HtmlPage3", but I cannot get just the "HtmlPage" one to work for now.

 
Alexandra70

Joined: 2004-12-08
Posts: 143
Posted: Tue, 2008-05-06 02:39

DUH!!!! It was a silly mistake... Thanks floridave for your help.

I had forgotten to change line 35 of the "UsefulInfo.inc" file I created.. from:

class HtmlPageView extends GalleryView {

To:

class UsefulInfoView extends GalleryView {

Duh!!!!

 
aartpapa

Joined: 2008-11-21
Posts: 1
Posted: Fri, 2008-11-21 10:57

Please anybody explain to me step by step how to add 4th page?
what files and lines to edit?
Because no matter what I'm doing to add 4th page appeared to be "Security Violation..."
http://artpapa.com/antonov
Thank you

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Fri, 2009-08-28 21:19
floridave wrote:
GusDoeMatik wrote:
Personally I think that that the Html module should be written with at least 2 static pages instead of 1 so simpletons, like me, ....

I have updated the module to have 3 pages.
It works on G2.1.1 and G2.2
http://gallery.menalto.com/node/28570?page=2#comment-228795
I will work on the codex as well.
_____________________________________________
Blog & G2 || floridave @ Gallery Team || G2 Theme Contest: +$3k in Prizes!

Hey Dave, does this module work with Gallery 2.3 ?

Thanks, Peace,
bburnett

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2009-08-28 22:00

I think so, but I have not tried recently. Give it a whirl and see if you can fill out the documentation as I have previously requested. Looking at the history of the codex page I don't see any activity.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
bburnett

Joined: 2008-09-03
Posts: 77
Posted: Sat, 2009-08-29 19:54

Gallery URL = http://www.thebucketdatabase.com/videos/main.php
Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.4 cgi
Webserver = Apache
Database = mysqlt 5.0.45-log, lock.system=flock
Toolkits = NetPBM, Gd, Thumbnail, ImageMagick, jpegtran
Acceleration = none, none
Operating system = Linux boscgi1701.eigbox.net 2.6.29.4 #1 SMP Mon Jun 1 13:08:14 EDT 2009 i686
Default theme = floatrix
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729)
Rows in GalleryAccessMap table = 51
Rows in GalleryAccessSubscriberMap table = 196
Rows in GalleryUser table = 6
Rows in GalleryItem table = 98
Rows in GalleryAlbumItem table = 14
Rows in GalleryCacheMap table = 0

It is currently installed but not working. Do I need to manually edit the .tpl files so they appear as HTML pages, and/or install URL Rewrite?

Can I just create an HTML page in MS Front Page and make the file name to match the Gallery directory?

One last question, since I am hosting all video and audio clips, do I need all those "Toolkits" installed, and if so should I make their priorities different?

Thanks for the help, I sincerely appreciate it.
bburnett