Page 1 of 2

Image Text Module

Posted: Thu Apr 14, 2005 2:48 pm
by megabob3
From an idea of Olaf, i started this module.

Donwload and try
http://wiki.cmsmadesimple.org/tiki-down ... p?attId=59

You can view it here:
http://www.awakening.it/test/index.php?page=qwe

To access on administration
user: admin
pass: admin


It's a beta version, next step create the ADMIN management of styles, fonts and cached images.

Bye.

Re: Image Text Module

Posted: Thu Apr 14, 2005 3:56 pm
by jah
Very nice output, but I cannot see anything on your Admin page for this module?

Re: Image Text Module

Posted: Thu Apr 14, 2005 4:05 pm
by megabob3
jah wrote: Very nice output, but I cannot see anything on your Admin page for this module?
I know, i am doing that part, you can enjoy it, changing the content, maybe ADDING new IMAGE TEXT.

Bye ;)

Re: Image Text Module

Posted: Thu Apr 14, 2005 4:45 pm
by jah
Aha, now I see from the module help page. This is very interesting. Would it be possible to use this for e.g. the {title} of the content pages?

Re: Image Text Module

Posted: Fri Apr 15, 2005 8:02 am
by megabob3
jah wrote: Aha, now I see from the module help page. This is very interesting. Would it be possible to use this for e.g. the {title} of the content pages?
I wrote the same thing about ADMIN on first post of this topic :P

About {title} i don't understand very well the request, do you want an Image Text over title caption of your browser????

If it is i don't think it's possible.

Bye :)

Re: Image Text Module

Posted: Fri Apr 15, 2005 9:52 am
by Ted
He means that he wants to automatically create an image with the text that's in {title}.  The module could possibly use the ContentTitle function to grab the title and then use it if a usetitle="true" option was passed to the module.

Re: Image Text Module

Posted: Fri Apr 15, 2005 10:22 am
by megabob3
wishy wrote: He means that he wants to automatically create an image with the text that's in {title}.  The module could possibly use the ContentTitle function to grab the title and then use it if a usetitle="true" option was passed to the module.
ooooo :O

i am studying ........ work in progress for a solution .......

few time ago i added this parameters {imagetext now='1' format='%d-%m-%Y --- %H:%M:%S ' style='big_bright' }
that create a dinamic ImageText with the current date/time.

i seeing.....

Re: Image Text Module

Posted: Fri Apr 15, 2005 10:37 am
by megabob3
Wishy may you give me some hint or tips on how include/lauch/execute a smarty plugin from DEFAULT action of a module?

This request only for find faster a solution. :D

Bye :)

Re: Image Text Module

Posted: Fri Apr 15, 2005 10:58 am
by megabob3
I did it :D

New parameters are:

"now" create the an ImageText with current Date/Time
"format" define the output of the Date/Time


"title" Create an ImageText of your Current PAGE

Bye :)

Re: Image Text Module

Posted: Fri Apr 15, 2005 11:07 am
by megabob3
Not very WELL now show the page_name and nope Title, work in progress alwasy :D

Re: Image Text Module

Posted: Fri Apr 15, 2005 11:36 am
by Ted
I don't know of any ways of using a smarty plugin in the default DoAction.  The module code isn't really integrated with smarty at all.

Re: Image Text Module

Posted: Fri Apr 15, 2005 12:32 pm
by megabob3
wishy wrote: I don't know of any ways of using a smarty plugin in the default DoAction.  The module code isn't really integrated with smarty at all.
Wishy

in this way i get the page_id
********
global $gCms;
$params['text'] = strtoupper($gCms->variables[page_name]);
********

Starting from $gCms i guess there is a method or something else for get the Title rigth?
Must i access from DB?

Bye :)

Re: Image Text Module

Posted: Fri Apr 15, 2005 12:38 pm
by Ted
I was thinking something like this would work...  ContentTitle will be called before DoAction('default'), so you should be good.

Code: Select all

class MyModule extends  CMSModule
{
  var $curtitle;
  function ContentTitle(&$title)
  {
    $this->curtitle = $title;
  }
}

Re: Image Text Module

Posted: Fri Apr 15, 2005 12:47 pm
by megabob3
wishy wrote: I was thinking something like this would work...  ContentTitle will be called before DoAction('default'), so you should be good.

Code: Select all

class MyModule extends  CMSModule
{
  var $curtitle;
  function ContentTitle(&$title)
  {
    $this->curtitle = $title;
  }
}
Ok thanks for this info, but at the moment ImageText is a special module, because isn't called like a module but like a smarty TAG.
Inside DoAction('default') i do NOTHING now.

From "function.imagetext.php" plugin of Smartys i got $gCms global variable structure, i am searching a way to get the Title from this structure.

I did this:

Code: Select all

class MyModule extends  CMSModule
{
  var $curtitle;
  function ContentTitle(&$title)
  {
    $this->curtitle = $title;
  }
}
But "curtitle" is BLANK.

Re: Image Text Module

Posted: Fri Apr 15, 2005 12:55 pm
by Ted
Oh, it's a plugin.  Gotcha.

Well, I just looked through the code and title is not put into $gCms anywhere.  You're only real option is:

Code: Select all

$contentobj = ContentManager::LoadContentFromId($id, false);
$title = $contentobj->GetName();