-
AuthorPosts
-
July 13, 2008 at 12:48 am #130787
I am using the Quillaja template and am trying to get the font/text resize tool to work. When you click on the “+” or “-” signs, nothing changes. It seems like it should have something to do with the the usertools or jascript. Can you please help me fix this so the plus and minus icons increase/decrease the font/text size?
bigrk Friendbigrk
- Join date:
- February 2007
- Posts:
- 1425
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 39
- Thanked:
- 45 times in 15 posts
July 13, 2008 at 1:08 am #259468Moving ti the Quillaja Forum so you can get the answer from other users of this template.
July 13, 2008 at 3:20 am #259475Since getting sent to the Quillaja section sounded like a death knell, I decided to just change the ja_templatetools.php file to match (more or less) the one from another template (Nejine, I think). The font size changer works now (which is what I needed) but, as you can see, the color tools don’t work and I don’t know how to remove them. If somebody knows how to turn those suckers off in the code, let me know. http://mycsas.com/
Thanks!
bigrk Friendbigrk
- Join date:
- February 2007
- Posts:
- 1425
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 39
- Thanked:
- 45 times in 15 posts
July 13, 2008 at 4:09 am #259476Dis you read this thread?
http://www.joomlart.com/forums/topic/ja-quillaja-readme-and-bug-report/July 13, 2008 at 1:13 pm #259499Thanks anyway, but that blurb about the tool config didn’t help. I needed to delete some code from the ja_templatetools.php file. I deleted the following code and now the template color options no longer show:
<ul class=”ja-usertools-color”>
<?php
foreach ($this->_ja_color_themes as $ja_color_theme) {
echo “
<a><img style=”cursor: pointer;” src=””.$this->templateurl().”/images/”.$ja_color_theme.( ($this->getParam(JA_TOOL_COLOR)==$ja_color_theme) ? “-hilite” : “” ).”.”.$imgext.”” title=””.$ja_color_theme.” color” alt=””.$ja_color_theme.” color” id=”ja-tool-“.$ja_color_theme.”color” onclick=”switchTool(‘”.$this->template.”_”.JA_TOOL_COLOR.”‘,’$ja_color_theme’);return false;” /></a>
“;
} ?>
</ul>Here is the full ja_templatetools.php file information that I used that worked for me. Hope it helps some other poor slob who only wants font size and page width options. No promise if it will work in other templates but I don’t see why not.. And, since only paid subscribers can see this forum, I figured it was OK to post.
<?php
define (‘JA_TOOL_COLOR’, ‘ja_color’);
define (‘JA_TOOL_SCREEN’, ‘ja_screen’);
define (‘JA_TOOL_FONT’, ‘ja_font’);
define (‘JA_TOOL_MENU’, ‘ja_menu’);
define (‘JA_TOOL_SIFR’, ‘ja_title_font’);
define (‘JA_TOOL_USER’, ‘usertool’);class JA_Tools {
var $_params_cookie = null; //Params will store in cookie for user select. Default: store all params
var $_tpl = null;
var $template = ‘ja_quillaja’;
//This default value could override by setting with function setScreenSizes() and setColorThemes()
var $_ja_screen_sizes = array (‘narrow’, ‘wide’);
var $_ja_color_themes = array (‘default’, ‘green’, ‘blue’);function JA_Tools ($template, $_params_cookie=null) {
$this->_tpl = $template;
$this->template = $template->template;
if(!$_params_cookie) {
$this->_params_cookie = $this->_tpl->params->toArray();
} else {
foreach ($_params_cookie as $k) {
$this->_params_cookie[$k] = $this->_tpl->params->get($k);
}
}$this->getUserSetting();
}function getUserSetting(){
$exp = time() + 60*60*24*355;
if (isset($_COOKIE[$this->template.’_tpl’]) && $_COOKIE[$this->template.’_tpl’] == $this->template){
foreach($this->_params_cookie as $k=>$v) {
$kc = $this->template.”_”.$k;
if (isset($_GET[$k])){
$v = $_GET[$k];
setcookie ($kc, $v, $exp, ‘/’);
}else{
if (isset($_COOKIE[$kc])){
if (($k == JA_TOOL_COLOR && ($this->getParam(JA_TOOL_USER) & 4)) ||
($k == JA_TOOL_SCREEN && ($this->getParam(JA_TOOL_USER) & 1)) ||
($k == JA_TOOL_FONT && ($this->getParam(JA_TOOL_USER) & 2)) ||
($k == JA_TOOL_MENU && $this->getParam(‘enable_cookie_for_menu’)) ){
$v = $_COOKIE[$kc];
}
}
}
$this->setParam($k, $v);
}}else{
@setcookie ($this->template.’_tpl’, $this->template, $exp, ‘/’);
}
return $this;
}function getParam ($param) {
if (isset($this->_params_cookie[$param])) {
return $this->_params_cookie[$param];
}
return $this->_tpl->params->get($param);
}function setParam ($param, $value) {
$this->_params_cookie[$param] = $value;
}function getCurrentURL(){
$cururl = JRequest::getURI();
if(($pos = strpos($cururl, “index.php”))!== false){
$cururl = substr($cururl,$pos);
}
$cururl = JRoute::_($cururl, true, 0);
return $cururl;
}function genToolMenu($ja_tools, $imgext = ‘gif’){
if($ja_tools & 1){//show screen tools
?>
<ul class=”ja-usertools-res”>
<?php
$i = 0;
foreach ($this->_ja_screen_sizes as $ja_screen_size) {
$i++;
echo “
<li><img style=”cursor: pointer;” title=”$ja_screen_size screen” src=””.$this->templateurl().”/images/user-screen”.$i. ( ($this->getParam(JA_TOOL_SCREEN) == $ja_screen_size) ? “-hilite” : “” ).”.”.$imgext.”” title=”$ja_screen_size screen resolution” id=”ja-tool-$ja_screen_size” onclick=”switchTool(‘”.$this->template.”_”.JA_TOOL_SCREEN.”‘,’$ja_screen_size’);return false;” /></li>
“;
}
?>
</ul>
<?php }if ($ja_tools & 2){//show font tools
?>
<ul class=”ja-usertools-font”>
<li><img style=”cursor: pointer;” title=”<?php echo JText::_(‘Increase font size’);?>” src=”<?php echo $this->templateurl();?>/images/user-increase.<?php echo $imgext;?>” alt=”<?php echo JText::_(‘Increase font size’);?>” id=”ja-tool-increase” onclick=”switchFontSize(‘<?php echo $this->template.”_”.JA_TOOL_FONT;?>’,’inc’); return false;” /></li><li><img style=”cursor: pointer;” title=”<?php echo JText::_(‘Decrease font size’);?>” src=”<?php echo $this->templateurl();?>/images/user-decrease.<?php echo $imgext;?>” alt=”<?php echo JText::_(‘Decrease font size’);?>” id=”ja-tool-decrease” onclick=”switchFontSize(‘<?php echo $this->template.”_”.JA_TOOL_FONT;?>’,’dec’); return false;” /></li>
<li><img style=”cursor: pointer;” title=”<?php echo JText::_(‘Default font size’);?>” src=”<?php echo $this->templateurl();?>/images/user-reset.<?php echo $imgext;?>” alt=”<?php echo JText::_(‘Default font size’);?>” id=”ja-tool-reset” onclick=”switchFontSize(‘<?php echo $this->template.”_”.JA_TOOL_FONT;?>’,<?php echo $this->_tpl->params->get(JA_TOOL_FONT);?>); return false;” /></li>
</ul><script type=”text/javascript”>var CurrentFontSize=parseInt(‘<?php echo $this->getParam(JA_TOOL_FONT);?>’);</script>
<?php?>
<?php
}}
function setScreenSizes ($_array_screen_sizes) {
$this->_ja_screen_sizes = $_array_screen_sizes;
}function setColorThemes ($_array_color_themes) {
$this->_ja_color_themes = $_array_color_themes;
}function getCurrentMenuIndex(){
$Itemid = JRequest::getInt( ‘Itemid’);
$database =& JFactory::getDBO();
$id = $Itemid;
$menutype = ‘mainmenu’;
$ordering = ‘0’;
while (1){
$sql = “select parent, menutype, ordering from #__menu where id = $id limit 1”;
$database->setQuery($sql);
$row = null;
$row = $database->loadObject();
if ($row) {
$menutype = $row->menutype;
$ordering = $row->ordering;
if ($row->parent > 0)
{
$id = $row->parent;
}else break;
}else break;
}$user =& JFactory::getUser();
if (isset($user))
{
$aid = $user->get(‘aid’, 0);
$sql = “SELECT count(*) FROM #__menu AS m”
. “nWHERE menutype='”. $menutype .”‘ AND published=’1’ AND access <= ‘$aid’ AND parent=0 and ordering < $ordering”;
} else {
$sql = “SELECT count(*) FROM #__menu AS m”
. “nWHERE menutype='”. $menutype .”‘ AND published=’1’ AND parent=0 and ordering < $ordering”;
}
$database->setQuery($sql);return $database->loadResult();
}function calSpotlight ($spotlight, $totalwidth=100, $firstwidth=0) {
/********************************************
$spotlight = array (‘position1’, ‘position2’,…)
*********************************************/
$modules = array();
$modules_s = array();
foreach ($spotlight as $position) {
if( $this->_tpl->countModules ($position) ){
$modules_s[] = $position;
}
$modules[$position] = array(‘class’=>’-full’);
}if (!count($modules_s)) return null;
if ($firstwidth) {
if (count($modules_s)>1) {
$width = round(($totalwidth-$firstwidth)/(count($modules_s)-1),1) . “%”;
$firstwidth = $firstwidth . “%”;
}else{
$firstwidth = $totalwidth . “%”;
}
}else{
$width = round($totalwidth/(count($modules_s)),1) . “%”;
$firstwidth = $width;
}if (count ($modules_s) > 1){
$modules[$modules_s[0]][‘class’] = “-left”;
$modules[$modules_s[0]][‘width’] = $firstwidth;
$modules[$modules_s][‘class’] = “-right”;
$modules[$modules_s][‘width’] = $width;
for ($i=1; $i<count ($modules_s) – 1; $i++){
$modules[$modules_s[$i]][‘class’] = “-center”;
$modules[$modules_s[$i]][‘width’] = $width;
}
}
return $modules;
}function isIE6 () {
$msie=’/msies(5.[5-9]|[6].[0-9]*).*(win)/i’;
return isset($_SERVER[‘HTTP_USER_AGENT’]) &&
preg_match($msie,$_SERVER[‘HTTP_USER_AGENT’]) &&
!preg_match(‘/opera/i’,$_SERVER[‘HTTP_USER_AGENT’]);
}function noBG4IE6() {
if ($this->isIE6())
echo ‘ style=”background: none;”‘;
}function baseurl(){
return JURI::base();
}function templateurl(){
return JURI::base().”templates/”.$this->template;
}function getRandomImage ($img_folder) {
$imglist=array();mt_srand((double)microtime()*1000);
//use the directory class
$imgs = dir($img_folder);//read all files from the directory, checks if are images and ads them to a list (see below how to display flash banners)
while ($file = $imgs->read()) {
if (eregi(“gif”, $file) || eregi(“jpg”, $file) || eregi(“png”, $file))
$imglist[] = $file;
}
closedir($imgs->handle);if(!count($imglist)) return ”;
//generate a random number between 0 and the number of images
$random = mt_rand(0, count($imglist)-1);
$image = $imglist[$random];return $image;
}function isFrontPage(){
return (JRequest::getCmd(‘option’)==’com_content’ && !JRequest::getInt(‘id’));
}function sitename() {
$config = new JConfig();
return $config->sitename;
}function genMenuHead(){
$html = “”;
if ($this->getParam(JA_TOOL_MENU)== ‘1’) {
$html = ‘<link href=”‘.$this->templateurl().’/ja_menus/ja_splitmenu/ja.splitmenu.css” rel=”stylesheet” type=”text/css” />’;
}else if ($this->getParam(JA_TOOL_MENU)== ‘2’) {
$html = ‘<link href=”‘.$this->templateurl().’/ja_menus/ja_cssmenu/ja.sosdmenu.css” rel=”stylesheet” type=”text/css” />
<script language=”javascript” type=”text/javascript” src=”‘. $this->templateurl().’/ja_menus/ja_cssmenu/ja.cssmenu.js”></script>’;
} else if ($this->getParam(JA_TOOL_MENU) == 4) {
$html = ‘<link href=”‘.$this->templateurl().’/ja_menus/ja_scriptdlmenu/ja.scriptdlmenu.css” rel=”stylesheet” type=”text/css” />
<script language=”javascript” type=”text/javascript” src=”‘.$this->templateurl().’/ja_menus/ja_scriptdlmenu/ja.scriptdlmenu.js”></script>’;
}
else if ($this->getParam(JA_TOOL_MENU) == 3) {
$html = ‘<link href=”‘.$this->templateurl().’/ja_menus/ja_transmenu/ja.transmenuh.css” rel=”stylesheet” type=”text/css” />
<script language=”javascript” type=”text/javascript” src=”‘.$this->templateurl().’/ja_menus/ja_transmenu/ja.transmenu.js”></script>’;
}
if ($this->getParam(JA_TOOL_USER)){
?>
<script type=”text/javascript”>
var currentFontSize = <?php echo $this->getParam(JA_TOOL_FONT); ?>;
</script>
<?php
}
echo $html;
}function jaGenHead($print = false){
$ja_title_font = ($this->getParam(JA_TOOL_SIFR)) ? $this->getParam(JA_TOOL_SIFR) : “ultra_vertex”;$css = ($print) ? “sIFR-print.css” : “sIFR-screen.css”;
JHTML::stylesheet($css,$this->templateurl().”/scripts/sifr202/”);$head = ‘
<script src=”‘.$this->templateurl().’/scripts/sifr202/sifr.js” type=”text/javascript” language=”javascript”></script>
<script src=”‘.$this->templateurl().’/scripts/sifr202/sifr-addons.js” type=”text/javascript” language=”javascript”></script><script type=”text/javascript”>
/* Replacement calls. Please see documentation for more information. */
function initSifr(){
// This is the preferred “named argument” syntax
sIFR.replaceElement( named({sSelector:”#ja-content span.ja-contentheading”, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#E9A853″, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#6B6B6B”}));sIFR.replaceElement(named({sSelector:”#ja-content .componentheading”, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”div.module h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”div.module-cyan h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#FFFFFF”, sLinkColor:”#FFFFFF”, sBgColor:”#66ACC7″, sHoverColor:”#FFFFFF”}));
sIFR.replaceElement(named({sSelector:”div.module-orange h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#FFFFFF”, sLinkColor:”#FFFFFF”, sBgColor:”#E9A853″, sHoverColor:”#FFFFFF”}));
sIFR.replaceElement(named({sSelector:”div.module-green h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#FFFFFF”, sLinkColor:”#FFFFFF”, sBgColor:”#BBC790″, sHoverColor:”#FFFFFF”}));
sIFR.replaceElement(named({sSelector:”div.moduletable h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”.ja-box h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”#ja-content h1″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”#ja-content h2″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”#ja-content h3″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”}));
sIFR.replaceElement(named({sSelector:”#ja-content h4″, sFlashSrc:”‘.$this->templateurl().’/scripts/sifr202/’.$ja_title_font.’.swf”, sColor:”#6B6B6B”, sLinkColor:”#E9A853″, sBgColor:”#FFFFFF”, sHoverColor:”#CCCCCC”, sCase:”upper”}));
};
jaAddEvent (window, “load”, initSifr);
</script>
‘;
echo $head;
}
}
?> -
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by slambeck 16 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum