Make a Lasting Impression

Get Involved!

Who's Online

12 user(s) are online (7 user(s) are browsing Support Forums)

Members: 1
Guests: 11

UnderDog, more...
ImpressCMS proudly uses SourceForge
ImpressCMS on Ohloh.net



« 1 2 3 (4) 5 6 7 »


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From Fort Worth, TX
Posts: 3111
cant you just do something like this.

Theme.php

global $xoopsConfig$xoopsModule$xoopsUser;
$this->template->assign( array(
'xoops_theme' => $xoopsConfig['theme_set'],
'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/',
'xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']),
'xoops_requesturi' => htmlspecialchars$_SERVER['REQUEST_URI'], ENT_QUOTES),
'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES),
'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES),
'xoops_dirname' => @$xoopsModule $xoopsModule->getVar'dirname' ) : 'system',
'xoops_banner' => $xoopsConfig['banners'] ? xoops_getbanner() : ' ',
'xoops_pagetitle' => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('name') : htmlspecialchars$xoopsConfig['slogan'], ENT_QUOTES ),
'icms_theme' => $xoopsConfig['theme_set'],
'icms_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/',
'icms_themecss'=> xoops_getcss($xoopsConfig['theme_set']),
'icms_requesturi' => htmlspecialchars$_SERVER['REQUEST_URI'], ENT_QUOTES),
'icms_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES),
'ismc_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES),
'icms_dirname' => @$xoopsModule $xoopsModule->getVar'dirname' ) : 'system',
'icms_banner' => $xoopsConfig['banners'] ? xoops_getbanner() : ' ',
'icms_pagetitle' => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('name') : htmlspecialchars$xoopsConfig['slogan'], ENT_QUOTES ),
) );


Wouldn't that make both work at the same time?

Posted on: 2008/11/16 16:58
_________________
My latest launched projects:MSRMX | GCC
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From in yur serps fukn up yur rankn
Posts: 214
Before today, I had not thought of that, so I started with a theme functions file. Today, I started looking in the core and looked at what you are referring to. However, I have not discussed with anyone what is planned for those sections of the core. AFAIK, w/ 2.0 those functions will be rewritten.

This still leaves an issue for Theme Devs. What do Theme Devs do when the old variables stop working? Do we go through every single theme we've made and rewrite those variables, or do we define a variable translation file?

If we extend this thinking just 1 step further... What do theme designers do when they want to include extended functionality? Do we include it directly in theme.html where it is difficult to manage and is bad form to mix logic with presentation? OR Do we define it in an external file which can be global to many themes and is much simpler to manage and update as needed?

Hence the concept of a theme_functions.php file that is optional. If the theme developer writes the file and includes it in the theme, the SMARTY engine should parse that file and "compile" it's variables as well, thus caching them with the other theme elements.

Make sense or am I just crazy? Wait... Don't answer that second part.

Posted on: 2008/11/16 17:25
_________________
JMorris (aka James Morris)
ImpressCMS Professional Services: INBOX International inc.
James Morris Online | Frolicking on the playground that is the Internet...
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From Spain
Posts: 954
A Smarty translation file would be fine and easy to do.

Something like:

<{assign var='foo' value=$xoops_whatever}>

Posted on: 2008/11/16 17:59
_________________
If you can't understand what I'm saying, you're not geek enough
ISegura.es
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From in yur serps fukn up yur rankn
Posts: 214
Quote:

nachenko wrote:
A Smarty translation file would be fine and easy to do.

Something like:

<{assign var='foo' value=$xoops_whatever}>


So, basically, this...

<?php

/*
* Theme functions definition file.
*
* The purpose of this file is to define and/or translate various 
* theme founctions for use in the ImpressCMS framework. Variables 
* that return such elements as block content and main content are 
* defined here. Additional elements that extend the default
* functionality of the ImpressCMS theme engine should be defined 
* in this file as well.
*
* @copyright    http://www.xoops.org/ The XOOPS Project
* @copyright    XOOPS_copyrights.txt
* @copyright    http://www.impresscms.org/ The ImpressCMS Project
* @license        http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL)
* @package        core
* @since        1.1
* @author        James Morris (aka JMorris) <jmorris77@users.sourceforge.net>
* @version        $Id$
*/

// ImpressCMS Information
<{assign var='version' value=$xoops_version}> // ImpressCMS Version
<{assign var='root_path' value=$xoops_rootpath}> // path to ImpressCMS root
<{assign var='upload_url' value=$xoops_upload_url}> // URL to ImpressCMS uploads directory
<{assign var='url' value=$xoops_url}> // URL to ImpressCMS root

// New Variables
 // Not sure if this translation will work
<{assign var='url' value=xoAppUrl /}> // same as old $xoops_url

// Site Information
<{assign var='charset' value=$xoops_charset}> // Charset used on the page, e.g. ISO-8859-1
<{assign var='langcode' value=$xoops_langcode}> // language code used for page (e.g. en for English)
<{assign var='site_name' value=$xoops_sitename}> // Site Name
<{assign var='slogan' value=$xoops_slogan}> // Site Slogan

// Meta tag information
<{assign var='meta_keywords' value=$xoops_meta_keywords}> // Meta tag keywords
<{assign var='meta_description' value=$xoops_meta_description}> // Meta tag site description
<{assign var='meta_copyright' value=$xoops_meta_copyright}> // Meta tag copyright text  
<{assign var='meta_robots' value=$xoops_meta_robots}> // Meta tag robot information  
<{assign var='meta_rating' value=$xoops_meta_rating}> // Meta tag rating information 
<{assign var='meta_author' value=$xoops_meta_author}> // Meta tag author information 
<{assign var='footer' value=$xoops_footer}> // Site footer text

// Theme Information
<{assign var='theme' value=$xoops_theme}> // Name of theme folder
<{assign var='theme_css' value=$xoops_themecss}> // URL to theme's css file 
  // (function xoops_getcss() returns a value based on the HTTP_USER_AGENT)

<{assign var='image_url' value=$xoops_imageurl}> // URL to theme folder

// New Variables
<{assign var='image_url}> = '<{xoImgUrl}> // same as old $xoops_imageurl

// User Information
<{assign var='is_user' value=$xoops_isuser}> // 1 if user is logged in, 0 if anonymous user
<{assign var='u_name' value=$xoops_uname}> // User name
<{assign var='notif_pref' value=$user_method}> // Logged in user's preferred notification method
<{assign var='is_admin' value=$xoops_isadmin}> // 1 if admin, 0 if not 
  // (Admin rights to current module is the deciding factor)
<{assign var='user_id' value=$xoops_userid}> // User's ID

// Blocks (only available if block contains content)
<{assign var='l_blocks' value=$xoops_lblocks}> // An array of the left blocks
<{assign var='block_title' value=$block.title}> // Title Of The Block Thats In The $xoops_??blocks array 
<{assign var='block_content' value=$block.content}> // content displayed by the block
<{assign var='show_c_blocks' value=$xoops_showcblock}> If TrueShows Center Blocks 
  
// ex: <{if $xoops_showcblock == 1}> center block's loop <{/if}> 
<{assign var='cl_blocks' value=$xoops_clblocks}> // Array of center-left blocks
<{assign var='cc_blocks' value=$xoops_ccblocks}> // Array of center-center blocks
<{assign var='cr_blocks' value=$xoops_crblocks}> // Array of center-right blocks
<{assign var='show_r_blocks' value=$xoops_showrblock}> // If True Shows Right Blocks 
  // ex: <{if $xoops_showrblock == 1}> right block's loop <{/if}> 
<{assign var='r_blocks' value=$xoops_rblocks}> // Array of right blocks

// New variables
<{assign var='cl_blocks' value=$xoBlocks.page_topleft}> // same as <{assign var='xoops_clblocks}> 
  // Array of top center-left blocks
<{assign var='cc_blocks' value=$xoBlocks.page_topcenter}> //  same as <{assign var='xoops_ccblocks}> 
  // Array of top center-center blocks
<{assign var='cr_blocks' value=$xoBlocks.page_topright}> //  same as <{assign var='xoops_crblocks}> 
  // Array of top center-right blocks
<{assign var='bl_blocks' value=$xoBlocks.page_bottomleft}> // new block position 
  // Array of bottom center-left blocks
<{assign var='BC_blocks' value=$xoBlocks.page_bottomcenter}> // new block position 
  // Array of bottom center-center blocks
<{assign var='br_blocks' value=$xoBlocks.page_bottomright}> // new block position 
  // Array of bottom center-right blocks
<{assign var='l_blocks' value=$xoBlocks.canvas_left}> //  same as <{assign var='xoops_lblocks}> 
  // An array of the left blocks
<{assign var='r_blocks' value=$xoBlocks.canvas_right}> //  same as <{assign var='xoops_rblocks}> 
  // Array of right blocks

// Page Information
<{assign var='page_title' value=$xoops_pagetitle}> // Page title, often assigned by the currently 
 // viewed module so that it reflects the page content. 
<{assign var='main_content' value=$xoops_contents}> // The content of the page
<{assign var='cur_dir' value=$xoops_dirname}> // The name of the current module directory. 
 // If no module is being displayed, this = "system"

// Banner
<{assign var='banner' value=$xoops_banner}> // Retrieves the banner from System Admin > Banners

// Miscellaneous
<{assign var='script_name' value=$SCRIPT_NAME}> // path to file name requested from root (e.g. modules/news/index.php)
<{assign var='request_uri' value=$xoops_requesturi}> // requested url (e.g. /modules/news/article.php?storyid=1)

// Control Structures
/**
* <{php}>
*   // php code;
* <{/php}>

* <{if condition}>
*   // what to do
* <{elseif another condition}>
*   // something to do if first condition is false and this condition is true
* <{else}>
*   // something to if first condition is false and second condition is false
* <{/if}>

* <{foreach item=key from=array}>
*   // what to do
* <{/foreach}>

* <{include file="path/file.ext"}>
*/

// Extended Functionality
/**
* Include here any special functionality you wish to include in your theme.* 
*/

?>


I'm a little unsure on <{assign var='url' value=xoAppUrl /}> though.

I haven't tested this. I'm getting ready to mod a local copy of iTheme to see if this will work.

Posted on: 2008/11/16 18:22
_________________
JMorris (aka James Morris)
ImpressCMS Professional Services: INBOX International inc.
James Morris Online | Frolicking on the playground that is the Internet...
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From Spain
Posts: 954
xoAppUrl is ... I don't know what is it for, honestly, I don't know why we have xoAppUrl (could find a more complicated name?) instead of $xoops_url, that has exactly the same value.

Posted on: 2008/11/16 18:30
_________________
If you can't understand what I'm saying, you're not geek enough
ISegura.es
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From Fort Worth, TX
Posts: 3111
<{xoAppUrl /}>

It was an elaborate conspiracy to drive me insane....

Honestly though, apparently they thought it was quicker than typing xoops - but after 4-5 years of typing xoops it comes out quicker than most other words. My fingers are engineered to type xoops from all the themes I have done.

Then one day someone decided to screw with me - they threw in some capital letters... damn you shift button!!!!

xoaPPurL - gah!

Posted on: 2008/11/16 18:38
_________________
My latest launched projects:MSRMX | GCC
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From Spain
Posts: 954
I'm discovering you and me think the same about all those post-morphogenesis addons to the theme engine.

Posted on: 2008/11/16 18:44
_________________
If you can't understand what I'm saying, you're not geek enough
ISegura.es
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From in yur serps fukn up yur rankn
Posts: 214
+1 more.

Love the technical proficiency. Hate the implementation. :hammer:

Posted on: 2008/11/16 18:48
_________________
JMorris (aka James Morris)
ImpressCMS Professional Services: INBOX International inc.
James Morris Online | Frolicking on the playground that is the Internet...
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From in yur serps fukn up yur rankn
Posts: 214
Ok, so the theme_functions.php file cannot be like I thought, but this does work...

Define the following in theme_functions.php. You may want to remove line breaks.

<!--
<{
assign var='version' value=$xoops_version}> 
<{
assign var='root_path' value=$xoops_rootpath}> 
<{
assign var='upload_url' value=$xoops_upload_url}> 
<{
assign var='url' value=$xoops_url}> 
<{
assign var='charset' value=$xoops_charset}> 
<{
assign var='langcode' value=$xoops_langcode}> 
<{
assign var='site_name' value=$xoops_sitename}> 
<{
assign var='slogan' value=$xoops_slogan}> 
<{
assign var='meta_keywords' value=$xoops_meta_keywords}> 
<{
assign var='meta_description' value=$xoops_meta_description}> 
<{
assign var='meta_copyright' value=$xoops_meta_copyright}> 
<{
assign var='meta_robots' value=$xoops_meta_robots}> 
<{
assign var='meta_rating' value=$xoops_meta_rating}> 
<{
assign var='meta_author' value=$xoops_meta_author}> 
<{
assign var='footer' value=$xoops_footer}> 
<{
assign var='theme' value=$xoops_theme}> 
<{
assign var='theme_css' value=$xoops_themecss}> 
<{
assign var='image_url' value=$xoops_imageurl}> 
<{
assign var='is_user' value=$xoops_isuser}> 
<{
assign var='u_name' value=$xoops_uname}> 
<{
assign var='notif_pref' value=$user_method}> 
<{
assign var='is_admin' value=$xoops_isadmin}> 
<{
assign var='user_id' value=$xoops_userid}> 
<{
assign var='l_blocks' value=$xoops_lblocks}> 
<{
assign var='block_title' value=$block.title}> 
<{
assign var='block_content' value=$block.content}> 
<{
assign var='show_c_blocks' value=$xoops_showcblock}>
<{
assign var='cl_blocks' value=$xoops_clblocks}> 
<{
assign var='cc_blocks' value=$xoops_ccblocks}> 
<{
assign var='cr_blocks' value=$xoops_crblocks}> 
<{
assign var='show_r_blocks' value=$xoops_showrblock}> 
<{
assign var='r_blocks' value=$xoops_rblocks}> 
<{
assign var='cl_blocks' value=$xoBlocks.page_topleft}> 
<{
assign var='cc_blocks' value=$xoBlocks.page_topcenter}> 
<{
assign var='cr_blocks' value=$xoBlocks.page_topright}> 
<{
assign var='bl_blocks' value=$xoBlocks.page_bottomleft}> 
<{
assign var='bc_blocks' value=$xoBlocks.page_bottomcenter}> 
<{
assign var='br_blocks' value=$xoBlocks.page_bottomright}> 
<{
assign var='l_blocks' value=$xoBlocks.canvas_left}> 
<{
assign var='r_blocks' value=$xoBlocks.canvas_right}> 
<{
assign var='page_title' value=$xoops_pagetitle}>
<{
assign var='main_content' value=$xoops_contents}>
<{
assign var='cur_dir' value=$xoops_dirname}>
<{
assign var='banner' value=$xoops_banner}>
<{
assign var='script_name' value=$SCRIPT_NAME}>
<{
assign var='request_uri' value=$xoops_requesturi}>
//-->


Include in the head section of theme.html after the $theme_name is defined.

<{includeq file="$theme_name/theme_functions.php"}>

Posted on: 2008/11/16 21:16
_________________
JMorris (aka James Morris)
ImpressCMS Professional Services: INBOX International inc.
James Morris Online | Frolicking on the playground that is the Internet...
Transfer the post to other applications Transfer


Re: Best Bare Knuckles Design For ImpressCMS --Official ImpressCMS Stuff--
Home away from home
Joined:
2007/12/4 8:00
From Fort Worth, TX
Posts: 3111
thats very cool James, thank you.

Posted on: 2008/11/16 22:24
_________________
My latest launched projects:MSRMX | GCC
Transfer the post to other applications Transfer



« 1 2 3 (4) 5 6 7 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.

[Advanced Search]