New module: AboutPage

dazza

Joined: 2005-04-24
Posts: 21
Posted: Fri, 2006-04-28 22:29

Hi,

Attached is a zip file for a module I have written that allows a seperate page for misc details etc.
I use it for an "About Me" type page.

Very simple to install/use:

Unpack in the modules directory, go to the site admin modules screen and install the module, configure it by putting your details in the "user message" edit box, save it and activate the module.

There will then be a "About" link in the top right links area that will display your message.

The message itself can contain BBCode or HTML formatting, but it needs the overall site settings to be set to BBCode or HTML in the General settings page.

I have tested it with G2.1 Matrix theme and PGThemes.

Hope it is of use to somebody...

AttachmentSize
aboutpage.zip6.01 KB
 
jaa1180

Joined: 2005-02-11
Posts: 48
Posted: Sat, 2006-04-29 03:37

Wow again!!!

This is exactly what I need. Now I have no need for Joomla.
I can now have my nice site with an about page.
Thank you so much for you hard work.

 
youpi

Joined: 2005-06-17
Posts: 35
Posted: Sat, 2006-05-06 01:39

thanks veryu much

 
stargirlnine

Joined: 2006-05-04
Posts: 5
Posted: Thu, 2006-05-11 23:48

This is exactly what I need too!! Thanks, Dazza! Great work, much appreciated!!

 
dazza

Joined: 2005-04-24
Posts: 21
Posted: Sun, 2006-05-14 22:21

you are all very welcome.

d.

 
qwenc
qwenc's picture

Joined: 2006-01-02
Posts: 7
Posted: Tue, 2006-05-16 16:12

This sounds interesting, but I'm not quite picturing it. Is there a place I can see it up and working?

Gallery version = 2.0.4 core 1.0.0.4
PHP version = 4.4.2 cgi
Webserver = Apache/1.3.33 (Unix)
Database = mysql 4.0.25-standard-log
Toolkits = Gd, NetPBM, ArchiveUpload
Operating system = Linux Hosted by 1and1

 
gadulia
gadulia's picture

Joined: 2006-05-11
Posts: 60
Posted: Wed, 2006-05-17 22:49

Dazza, you are a genius. Small things often run the world. You just seem to know what realy matters in live!

© qwenc

I've just installed it if you want to have a look. It's not finished yet, but you can see what is ment by it.

"http://www.swissphoto.net/galerie/main.php?g2_view=core.UserAdmin&g2_subView=aboutpage.About&g2_return=%2Fgalerie%2Fmain.php&g2_returnName=Album"

gadulia

 
dazza

Joined: 2005-04-24
Posts: 21
Posted: Thu, 2006-05-18 22:45

qwenc,

the basic use for the module is a simple way for the gallery administrator to have a static page displaying information about the gallery.
clicking on a link in the top right called About will display the static page.

I wrote the module so I could have a static page with an introduction and general information about myself / my pictures.

gadulia's link above (thanks) shows their static page.

d.

 
qwenc
qwenc's picture

Joined: 2006-01-02
Posts: 7
Posted: Fri, 2006-05-19 06:49

Thank you dazza and gadulia. You have both been very helpful. :)

Gallery version = 2.0.4 core 1.0.0.4
PHP version = 4.4.2 cgi
Webserver = Apache/1.3.33 (Unix)
Database = mysql 4.0.25-standard-log
Toolkits = Gd, NetPBM, ArchiveUpload
Operating system = Linux Hosted by 1and1

 
halftone

Joined: 2005-09-29
Posts: 22
Posted: Sat, 2006-05-20 16:31

gwenc, sadly, it doesn't work with G2.0.n

Regards
Tony

 
danielmauch

Joined: 2006-05-31
Posts: 9
Posted: Tue, 2006-06-06 13:20

Hi

Where can I translate the name "about" which appears in the up/right corner???

Daniel

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-06-06 22:55
 
hmobron

Joined: 2006-05-30
Posts: 6
Posted: Fri, 2006-06-09 09:33

Don't we need the po file for that? Or do i miss someting.

I use poEdit windows.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-06-09 15:34

oh, if the module doesn't have a po dir already then just create it and copy a GNUmakefile from any other module.

 
hmobron

Joined: 2006-05-30
Posts: 6
Posted: Fri, 2006-06-09 18:28

aboutpage has a po dir and an GNUmakefile in it. But when i run make nl.po a got a error can't find tools/po.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-06-09 20:03

please recheck the instructions i linked above.. do you have a developer install or svn or nightly snapshot?

 
jonathon

Joined: 2006-07-17
Posts: 9
Posted: Tue, 2006-07-18 06:53

How do I edit the text or image link?

 
WItch

Joined: 2005-10-27
Posts: 57
Posted: Mon, 2006-07-24 00:35

thank you, that is just what i needed!

 
skiller2k1

Joined: 2006-03-18
Posts: 6
Posted: Tue, 2006-08-08 21:20

Hi and thank you for your great modules about and contact owner! How can i rewrite the very long URL "main.php?g2_view=core.UserAdmin&g2_subView=aboutpage.About&g2_return=main.php%3F&&g2_returnName=Album" eg. into "about.html"? Can you implement the Gallery2 Rewriting API?

This Question is also for the great Contact Owner module...

Greetings
Michael

EDIT: Find it. Simply add to module.inc:

    /**
     * @see GalleryModule::getRewriteRules
     */
    function getRewriteRules() {
           $rule = array('comment' => $this->translate('Aboutpage'),
                         'match' => array('view' => 'aboutpage.About'),
                         'pattern' => 'about.html');
    return array($rule);
    }

Thanks for your great modules ;)

 
fotoloco

Joined: 2006-09-04
Posts: 2
Posted: Fri, 2006-09-15 19:04

Now that i've installed the module, how can i edit the text block?
Theren't links in the module admin page, nor in the about page.
Any ideas?
Lka

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2006-09-15 21:08

site admin / About page
there's textbox there to fill in your text.

 
Le3hy0r1

Joined: 2006-10-31
Posts: 2
Posted: Fri, 2006-11-10 03:41

thanks for the great the great module @@

 
Nathan MacInnes

Joined: 2006-11-30
Posts: 18
Posted: Wed, 2006-12-06 03:49

Here's a tip for everyone:
I wanted another static page which did exactly the same thing, but with a different title, so I copied the aboutpage folder (before module install), and then went through each file replacing "about" or "About" with my own title. Then, I had my own custom static page module. You can do this as many times as will fit in the links bar.

 
Nathan MacInnes

Joined: 2006-11-30
Posts: 18
Posted: Thu, 2006-12-14 15:50

Hey Dazza,
This is a great module, and thanks for all your hard work. Do you think you could fix a couple of things? The title says "Gallery User Administration", and the sidebar has a login link and stuff. Do you think you could fix all that? I don't want my users to have to see that stuff.

Also, it would be nice to be able to do the stuff I described in the above post a little more cleanly, with text boxes to choose the titles, etc. Maybe have a "static pages" module, and be able to add new static pages, all in one module. Just a thought.
Thanks again.
-Nathan

 
milfodd
milfodd's picture

Joined: 2002-11-11
Posts: 15
Posted: Sat, 2007-01-13 22:10

Perfect. Easiest mod to install and configure ever.
10/10

 
wookie7070

Joined: 2007-01-14
Posts: 2
Posted: Mon, 2007-01-15 00:01

I love the modules you have created. Thanks. Can you tell me how I can increase the font size to say 14 in the AboutPage module. I have managed it with the HTML setting on the general tab but cannot seem to be able to get it to work with the recommended BBcode. My Narrative Where am I going wrong. I enter from the site admin about link.

 
Astor

Joined: 2005-12-15
Posts: 154
Posted: Fri, 2007-01-26 09:55

Excuse for my bad english .
I used this great module with PGtheme.
Can i view "Contact:" section in the whole page, without sidebar section in the left ?

This is my test page http://tinyurl.com/2dseh6

Tnx in advance

 
goodfellas

Joined: 2007-02-03
Posts: 22
Posted: Sun, 2007-02-11 22:07

I also would like to increase the font size of the AboutPage module. Does anybody know?

 
goodfellas

Joined: 2007-02-03
Posts: 22
Posted: Tue, 2007-02-13 19:01

Does anybody know how the font and size can be changed on the AboutPage module?
Been through all the files for this module, but no luck.

 
thefluffyshrimp

Joined: 2007-02-25
Posts: 72
Posted: Mon, 2007-03-05 19:46

This is exactly what I need. The only catch is that I need the new link to direct to a pre-existing "About" page on my main site, without having to remake the page. Instead of making a new page, can I use this module to just link to a page already in existance?

It seems like it would actually be easier, but I'm not sure how to do it.

Thank you for any help! :D

 
jeffmmiller

Joined: 2007-03-01
Posts: 71
Posted: Thu, 2007-03-08 19:33
goodfellas wrote:
Does anybody know how the font and size can be changed on the AboutPage module?
Been through all the files for this module, but no luck.

http://www.w3schools.com/html/html_formatting.asp

or

http://gallery.menalto.com/filter/tips/5

 
jeffmmiller

Joined: 2007-03-01
Posts: 71
Posted: Fri, 2007-03-09 10:58

I was wondering how to make the text go around the right of the inserted image. BBCode [float=left] image formating doesn't seem to work to make the image float left of a paragraph.

 
Taps7734

Joined: 2005-09-15
Posts: 17
Posted: Wed, 2007-05-16 00:28

OK. I like this. It works well.

But..... How hard would it be to add an item in the URL Rewrite admin page? So you can change the URL to http://somesite.com/about instead of the lengthy URL it creates.

EDIT: Let me reword that question so it makes sense. How can I get the module to change the ABOUT link to use the short URL from the rewrite as well. I saw the above comment where it added the rewrite rules, but the link in the menus still goes to the long URL.

 
Taps7734

Joined: 2005-09-15
Posts: 17
Posted: Wed, 2007-05-16 01:22

OK... I kind of got it figured out. But I need to still see if I can get it to remove the info for the BACK link.

If I use the following code in the module.inc, I can get it to change the LINK url to the correct rewritten form. But now I need to figure out how to get it to stop putting in the querystring of about.html?g2_return=%2Fabout.html&g2_navId=xfb5f57da

    /**
    * @see GalleryModule::getRewriteRules
    */
    function getRewriteRules() {
        $rules = array();

        $rule = array();
        $rule['match'] = array('view' => 'core.UserAdmin', 'subView' => 'aboutpage.About');
        $rule['pattern'] = 'about.html';
        $rule['comment'] = $this->translate('About Page');
        $rules[] = $rule;

        return $rules;
    }
 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2007-05-16 22:14

to remove those, remove , 'return' => 1 in function getSystemLinks in module.inc

 
Eric A.

Joined: 2007-05-21
Posts: 88
Posted: Sun, 2007-06-10 16:58

Hello,

I have the same problem as Taps7734 for the function getRewriteRules

My Link is www.mysite.de/impressum?g2_return=%2Ftestbilder%2Fgallery2%2Fmain.php%3Fg2_view%3Dcore.UserAdmin%26g2_subView%3Dcore.UserLogin%26

and I wish www.mysite.de/impressum

Mindless: what do you mean with

Quote:
to remove those, remove , 'return' => 1 in function getSystemLinks in module.inc

here is module.inc

Quote:
<?php
/*
* $RCSfile: module.inc,v $
*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2005 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

/**
*
* @package AboutPage
* @author Darren Guiden <g2@pengs.co.uk>
*/

/**
* Display a page that user can put own content on
*
* @package AboutPage
*/
class AboutPageModule extends GalleryModule {

function AboutPageModule() {
global $gallery;
$this->setId('aboutpage');
$this->setName('About Page');
$this->setDescription($gallery->i18n('Display a page of user content'));
$this->setVersion('0.0.1');
$this->setGroup('display', $gallery->i18n('Display'));
$this->setCallbacks('getSystemLinks|getSiteAdminViews');
$this->setRequiredCoreApi(array(7, 2));
$this->setRequiredModuleApi(array(3, 0));
}

/**
* @see GalleryModule::needsConfiguration
*/
function needsConfiguration() {
list ($ret, $value) = $this->getParameter('message');
if ($ret) {
return array($ret->wrap(__FILE__, __LINE__), null);
}
return array(null, empty($value));
}

/**
* @see GalleryModule::getSiteAdminViews
*/
function getSiteAdminViews() {
return array(null, array(array('name' => $this->translate('About'),
'view' => 'aboutpage.Admin')));
}

/**
* @see GalleryModule::getSystemLinks
*/
function getSystemLinks() {
$links = array();

$links['AboutPage'] = array(
'text' => $this->translate('About'),
'params' => array('view' => 'core.UserAdmin',
'subView' => 'aboutpage.About',
'return' => 1));

return array(null, $links);
}

/**
* @see GalleryModule::getConfigurationView
*/
function getConfigurationView() {
return 'aboutpage.Admin';
}

/**
* @see GalleryModule::getRewriteRules
*/
function getRewriteRules() {
$rules = array();

$rule = array();
$rule['match'] = array('view' => 'core.UserAdmin', 'subView' => 'aboutpage.About');
$rule['pattern'] = 'about_page.html';
$rule['comment'] = $this->translate('About Page');
$rule['help'] = $this->translate('Short URL for the About Page');
$rules[] = $rule;

return $rules;
}
}
?>

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-06-11 06:05

i mean remove the text 'return' => 1 and the comma before it in the function called getSystemLinks. this answers the question above about how to omit the g2_return and g2_navId values in the URL.

 
Eric A.

Joined: 2007-05-21
Posts: 88
Posted: Tue, 2007-06-26 20:02

Sorry, I just see now your answer.

I change

Quote:
/**
* @see GalleryModule::getSystemLinks
*/
function getSystemLinks() {
$links = array();

$links['AboutPage'] = array(
'text' => $this->translate('About'),
'params' => array('view' => 'core.UserAdmin',
'subView' => 'aboutpage.About',
'return' => 1
));

return array(null, $links);
}

into

Quote:
/**
* @see GalleryModule::getSystemLinks
*/
function getSystemLinks() {
$links = array();

$links['AboutPage'] = array(
'text' => $this->translate('About'),
'params' => array('view' => 'core.UserAdmin',
'subView' => 'aboutpage.About'));

return array(null, $links);
}

 
Eric A.

Joined: 2007-05-21
Posts: 88
Posted: Sun, 2007-07-01 11:02

GREAT

I just have try this change: It works!!!!

another question: how / where can I change the HTML TITLE:
I alway have the same title as the login

Quote:
<title>Benutzer-Administration der Gallery</title>

I wish something like that: <title>about page</title>

 
minikomi

Joined: 2007-07-19
Posts: 5
Posted: Fri, 2007-08-10 01:34

I'm wondering if its possible to have a different about page for separate users?

 
girlyReads

Joined: 2007-08-15
Posts: 14
Posted: Mon, 2007-08-20 19:55
Eric A. wrote:
GREAT

I just have try this change: It works!!!!

another question: how / where can I change the HTML TITLE:
I alway have the same title as the login

Quote:
<title>Benutzer-Administration der Gallery</title>

I wish something like that: <title>about page</title>

Bit late but decided to post so someone else didn't spend half the night working this out ;) (Yes, I really should get a life!)

In theme.tpl:

find

Quote:
{* Let Gallery print out anything it wants to put into the <head> element *}

replace

Quote:
{g->head}

with:

Quote:
{if $smarty.server.REQUEST_URI == '/main.php/aboutpage'}
{g->head|replace:"Gallery User Administration":"Your-preferred-title-here"}
{else}
{g->head}
{/if}

* Assumes your theme includes {g->head} (I'm using matrix)
* Assumes you are using URL_Rewrite to get a url of /main.php/aboutpage - otherwise replace with your own URL.
* Don't forget to create a folder named local in the directory you found theme.tpl and save the amended version there, rather than overwrite your original theme.tpl

I only installed Gallery2 less than a week ago, so feel free to shout up if this is crackers but after umpteen coffee's, this is the best I got :D

Cheers

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-08-20 20:41

Another thing to try: edit aboutpage/module.inc, function getSystemLinks and change 'view' => 'core.UserAdmin', 'subView' => 'aboutpage.About' to just 'view' => 'aboutpage.About'. Then the title should be 'Contact :: About', which you can edit in About.inc

 
girlyReads

Joined: 2007-08-15
Posts: 14
Posted: Tue, 2007-08-21 12:14

Cool, thats much easier actually! I'll create a new module and edit it appropriately.

Thanks

P.S This also solves the sidebar issue if that's been giving anyone a headache.

 
Eric A.

Joined: 2007-05-21
Posts: 88
Posted: Sun, 2007-08-26 06:13

@mindless:
I change in the module module.inc the function getSystemLinks into

Quote:
function getSystemLinks() {
$links = array();

$links['AboutPage'] = array(
'text' => $this->translate('About'),
'params' => array('view' => 'aboutpage.About'));

Now, as you wrote, I see the Title "Contact::About"

I suppose the title comes from module About.inc

Quote:
$template->setVariable('form', $form);
$template->title($gallery->i18n('Contact') . '::' .
$gallery->i18n('About'));

Now I have two new issues:
* The title ("Contact::About") is now better as before but not perfect. I want to change it to my German translation. I mean the title muss supports the normal translation process [with g->text or something like that].
I read the help (http://gallery.menalto.com/apidoc/GalleryCore/Classes/Gallery.html#methodi18n, http://gallery.menalto.com/apidoc/GalleryCore/Classes/GalleryPlugin.html#methodtranslate, ...) an try a lot but I not found the right answer.
Can you help me?

* the RewriteRules does not work after this last change (see above):
Before the change I have www.mysite.de/.../impressum (I set in the URL Rewrite "Impressum").
After the chane of the view I become www.mysite.de/.../main.php?g2_view=aboutpage.About

What can I do to fix the two issues?

thanks
Eric

PS: I take the same change for the module contactowner and become the same issues

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2007-08-26 15:43

2) remove core.UserAdmin in the getRewriteRules function of module.inc too.. you may need to then reactivate URL rewrite module and/or about module.

1) change the $gallery->i18n to $module->translate in About.inc. then just above that line add:

list ($ret, $module) = GalleryCoreApi::loadPlugin('module', 'about');
if ($ret) {
    return array($ret, null);
}
 
skidpics

Joined: 2007-11-06
Posts: 43
Posted: Tue, 2007-11-27 16:22

Not sure if it has anything to do with the plugin, but I installed it, configured it, and then.. my plugin page will not show again.

I went back with the browser and lukily the page was in cache, and uninstalled it, but now, my plugin page will not show - all else is working fine and this is the only plugin that I installed before and after this issue..

Have you heard of anything like that? and if so, what do I need to do to fix this issue?

-- Skidpics

 
schrecklich

Joined: 2008-01-03
Posts: 57
Posted: Fri, 2008-01-04 13:47

Is there a way the about page could just display preexisting html pages in its window, without putting the html code in there, just telling it the location of the page to display.

Sort of like frames in html. Or is there any other plugin that is able to do so?

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Fri, 2008-01-04 14:07

use htmlitem module. you can edit files and then display them.
serbanc - www.e-poze.ro

 
schrecklich

Joined: 2008-01-03
Posts: 57
Posted: Fri, 2008-01-04 15:29

I dont think this is what i'm realy looking for.

I would like the option to add links to the space where the Login Option is, just as the AboutPage-Plugin and then i would want it to open a external link, a Guestbook.php, an allready existing aboutme.html page. But it should open in the gallery environment, as the AboutPage-Plugin does.

 
serbanc

Joined: 2006-05-19
Posts: 314
Posted: Fri, 2008-01-04 15:40
 
schrecklich

Joined: 2008-01-03
Posts: 57
Posted: Fri, 2008-01-04 15:55

I think so yes, how do i do that with your that plugin you mentioned?