Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed

» Visit forum | » View latest posts

Need some help Please  Bottom

Go to page 1 - 2 [+1]:

  • 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
  • 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
  • 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.
  • 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
  • Great
    I'll have a look at that, much appreciated, Thumbs up to AutoTheme.

    Thanks Shawn.

    Kindest regards
    Micheal
  • 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 "\"".$module."\"\n"; }';


    How can I change this to represent the image path to each module.

    Thanks for any help Shawn

    Kindest Regards
    Micheal.
  • 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>
  • 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 "\"".$module."\"\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.
  • lol icon_redface 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.
  • 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
  • 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 "\"".$module."\"\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 tag

    Quote

    [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.
  • 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.....

    wink

    -Mark
  • LOL icon_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
  • It's hard work but most of us derive some strange satisfaction from it. I hope Forest make it too.

    -Mark
  • 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

Go to page 1 - 2 [+1]:

This list is based on users active over the last 60 minutes.