Greetings
I've nearly completed a new theme for my site but have a little space between the logo and banner for a "You are here Image", which I would like to have represent the page that is being visited... My problem is how to make each image show.
Has anyone done something like this before and if so can you help me out please.
Thanks
Kindest regards
Micheal
http://www.bestwoodtriangle.co.uk
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mdee responded to »Short URL questions« 12:02 AM
- mesteele101 responded to »Problem in Database Connection« 21. May
- mesteele101 created topic »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 20. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
- mesteele101 created topic »File packaging« 16. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Need some help Please
-
- Rank: Expert
- Registered: Aug 20, 2002
- Last visit: Jan 12, 2010
- Posts: 1219
Maybe someting like:
$module = pnModGetName();
switch($module) {
case "Web_Links":
$img="weblinks.gif";
break;
case "Downloads":
$img="dl.gif";
break;
}
echo "";
-----
Could be simpler or more complex, but that's the general idea.
-Shawn -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
Thanks Shawn, had a feeling it would be complicated but am determined to have a crack at it.
The theme I've created is using AutoTheme Lite, now can I enter those commands in the commands.inc script or the theme cfg and then use a call in the HTML page.
It's a shame that each module doesn't have it's own image which could be called via the theme each time that module page is loaded so you could end up with an easy piece of code much like the pnBannerDisplay()
I'm not a coder but like I said I'm determined to make this work.
Thanks Micheal. -
- Rank: Expert
- Registered: Aug 20, 2002
- Last visit: Jan 12, 2010
- Posts: 1219
Actually, if you're using AutoTheme then each module can have it's own image. Look in theme.cfg, for each custom_module you can define 'logo' => "thenews.gif". Then in your template use [logo-image] and it will display the appropriate image based on the module. It is actually doing this in the AT-Lite sample theme that is included with AutoTheme.
-Shawn -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
Great
I'll have a look at that, much appreciated, Thumbs up to AutoTheme.
Thanks Shawn.
Kindest regards
Micheal -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
Great it works, but! in order for it to work for each module I would have to write out the following several times
$custom_module['gallery'] = array (
'logo' => "clientlist.gif", // [logo-image]
'right' => true,
);
substituting 'gallery' for whatever module I wish to call which is a long process........What if we made things simpler.
let the theme identify the module page and then call up the image from the module directory, call the image clientlist.gif in each module and bobs your uncle an automated process for each module, "A you are here image displayed wherever you put the tag"
I noticed the [logo-image] command in command.inc which is:
Quote
$command['[logo-image]'] = 'if ($logoimg && file_exists($imgpath.$logoimg)) {'
.'echo "\n"; }';
How can I change this to represent the image path to each module.
Thanks for any help Shawn
Kindest Regards
Micheal. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
I'm not sure how this would fit in to AutoTheme but from the PN API docs you have some functions that may help.
pnModGetName - get name of current top-level module
pnModGetIDFromName - get module id from name
pnModGetInfo - get module info
Then you could include modules/<modname>/[images/pnimages]/<modname>.png.
-Mark</modname></modname> -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
Okay I've done it forgive the coding ....but like I said I'm not a coder ,
Thanks to Shawn and Mark I'm now able to have a you are here image for every module, those modules that I don't want displayed will show a blank.gif.
So here is what I did....
In theme cfg I changed the code at the bottom and now looks like this
Quote
$custom_module['$modname'] = array (
'logo1' => "clientlist.gif", // [logo-image]
'right' => true,
);
In the command inc script I changed the following values to identify the new code and call the image
Quote
$command['[logo-image]'] = 'if ($logoimg1 && file_exists($imgpath1.$logoimg1)) {'
.'echo "\n"; }';
and then in autotheme.inc I created a new value around line 30
Quote
$imgpath1 = $modname."pnimages/";
and around line 88 I added this value
.Quote
$logoimg1 = $miscellaneous['logo1'];
then just placed as the tag in the theme.html where I need the image to show.
Thanks guys.......take care
Kindest Regards
Micheal. -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
lol
must of been dreaming ....don't exactly know what I seen but convinced myself I had it .......jumping the gun is my forte ....didn't work major head...banging.....
take no notice of the above code is complete non-sense...much like me I'm afraid ...sorry ...guys. -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
SHHEEES ....can totally appreciate the agony and headaches you coders have . Well i'm a step closer and have managed to pull the images from the actual $module/pnimages which is fantastic, however i'm still limited to the module thats being called. What I need is the following code to call all modules.
Quote
$custom_module['gallery'] = array (
'logo1' => "clientlist.gif", // [logo-image]
'right' => true,
);
That piece of code limits me to one module how do I get it to apply to all modules and not just one.
I''l put up a makeshift image for the gallery section of the site which will show you the image is being called from the module.
http://www.bestwoodt…=gallery&file=index -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
AHHHRRR Bliss I've done it the code above was'nt needed, as soon as I removed it it reverted to the code above which gets thte style and background colours.
I have what I needed now it's time to build them images I've put up a few make shift images ....just words.... take a look ....
Here's the changes I made.
In theme.cfg
I removed the following from around line 134:
Quote
$custom_module['gallery'] = array (
'logo' => "clientlist.jpg", // [logo-image]
'right' => true,
Then in the same page I added to around line 124 & line 56
Quote
'logo1' => "clientlist.jpg", // [logo-image]
In the commands.inc page I changed the $command['[logo-image]'] value all of it to
Quote
command['[logo-image]'] = 'if ($logoimgs && file_exists($imgpaths.$logoimgs)) {'
.'echo "\n"; }';
And added a new value to the same page just underneath $command['[image-path]'] = 'echo $imgpath;';
Quote
$command['[image-paths]'] = 'echo $imgpaths;';
Then in the Autothem.inc I added under where it says $imgpath = $themepath."images/";
Quote
$imgpaths = "modules/".$module."/pnimages/";
Around line 89 of the same page I added
Quote
$logoimgs = $miscellaneous['logo1'];
Then in the theme.html I added the tagQuote
[logo-image]
which calls the image...
Thats it job done Oh and don't change anything until you've backed up all those pages I've mentioned.
Hope somebody else can benefit from that ....
Thanks for all your help
Kindest Rergards
Micheal. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Michael,
Welcome to the wonderful world of coding.
As an officially sanctioned representative of the coders guild I now bestow on you the title of coder.
And once we've got you there's no escape. cue evil laugh.....
-Mark -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: Jun 03, 2003
- Posts: 41
LOL
You must be joking I couldn't do this day in day out my heads pounding ......respect to all you coders/developers it's hard work.
As for that forest sign.......hahah....your talking to a county fan!
Hope Forest make it to the premiership
Take Care Mark and thanks.
Kindest Regards
Micheal. :D -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
It's hard work but most of us derive some strange satisfaction from it. I hope Forest make it too.
-Mark -
- Rank: Expert
- Registered: Aug 20, 2002
- Last visit: Jan 12, 2010
- Posts: 1219
Good job! I'll look at posting something a little easier that doesn't require moding the existing code. One thing to be aware of is that $module will not always be the module dir. For example, when $module = "Polls" the dir will actually be NS-Polls/.
-Shawn
- Moderated by:
- Support
