• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Enhancement: disable/enable Show/Hide buttons for Smileys an

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Postby Bernhard J. M. Grün » Tue Feb 28, 2006 3:49 pm

The following enhancement makes it possible to let the administrator/webmaster decide if he wants the the show/hide buttons to be enabled or not. It also fixes a small bug that was present until now: If you disable the who's online list or the smileys list the buttons to show hide the boxes were still present.

This patch also includes some changes to empty lines. My editor kills unneded spaces at the end of lines. ;-)

Code: Select all
Index: themes/default/templates/chat.html.tpl.php
===================================================================
--- themes/default/templates/chat.html.tpl.php   (Revision 324)
+++ themes/default/templates/chat.html.tpl.php   (Arbeitskopie)
@@ -25,10 +25,14 @@
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/logout.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>loginlogout" onclick="pfc.connect_disconnect()" /></div>
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/color-on.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>nickmarker" onclick="pfc.nickmarker_swap()" /></div>
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/clock-on.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>clock" onclick="pfc.clock_swap()" /></div>
+      <?php if ($c->btn_sh_smileys && $c->showsmileys) { ?>
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/smiley-on.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>showHideSmileysbtn" onclick="pfc.showHideSmileys()" /></div>
+      <?php } ?>
+      <?php if ($c->btn_sh_whosonline && $c->showwhosonline) { ?>
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/online-on.gif'); ?>" alt="" title="" id="<?php echo $prefix; ?>showHideWhosOnlineBtn" onclick="pfc.showHideWhosOnline()" /></div>
+      <?php } ?>
     </div>
-   
+
     <div id="<?php echo $prefix; ?>bbcode_container">
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/bt_strong.gif'); ?>" alt="<?php echo _pfc("Bold"); ?>" title="<?php echo _pfc("Bold"); ?>" id="<?php echo $prefix; ?>bt_strong" onclick="pfc.insert_text('[b]','[/b]')" /></div>
       <div class="<?php echo $prefix; ?>btn"><img src="<?php echo $c->getFileUrlFromTheme('images/bt_em.gif'); ?>" alt="<?php echo _pfc("Italics"); ?>" title="<?php echo _pfc("Italics"); ?>" id="<?php echo $prefix; ?>bt_strong" onclick="pfc.insert_text('[i]','[/i]')" /></div>
Index: src/phpfreechatconfig.class.php
===================================================================
--- src/phpfreechatconfig.class.php   (Revision 324)
+++ src/phpfreechatconfig.class.php   (Arbeitskopie)
@@ -50,16 +50,18 @@
   var $openlinknewwindow   = true; // used to open the links in a new window
   var $showwhosonline      = true;
   var $showsmileys         = true;
- 
+  var $btn_sh_whosonline   = true; // display show/hide button for who is online
+  var $btn_sh_smileys      = true; // display show/hide button for smileys
+
   var $theme               = "default";
   var $themepath           = "";
   var $themeurl            = "";
   var $themepath_default   = "";
   var $themeurl_default    = "";
- 
+
   var $language            = "";      // could be something in i18n/* directory ("" means the language is guess from the server config)
   var $output_encoding     = "UTF-8"; // could be ISO-8859-1 or anything else (which must be supported by iconv php module)
-  var $container_type      = "File"; 
+  var $container_type      = "File";
 
   var $client_script_path  = "";
   var $client_script_url   = ""; // default is calculated from 'client_script_path'

Bernhard
Bernhard J. M. Grün
Member
 
Posts: 13
Joined: Thu Feb 23, 2006 3:42 pm
Location: Püttlingen, Saarland, Germany
  • Website
  • ICQ
Top

Postby phpfreechat » Tue Feb 28, 2006 4:21 pm

A demo to illustrate these parameters whould be nice.

However I just integrated your patch.

-----
Memento:
1.I copy/paste your patch into phpfreechat/trunk/patch.txt
2. I typed this command : cd phpfreechat/trunk/ && patch -p0 < patch.txt
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby Nemako » Thu Mar 02, 2006 9:49 am

great thanks Bernhard J. M. Grün
Nemako
Nemako
Member
 
Posts: 44
Joined: Fri Feb 10, 2006 1:52 pm
  • Website
Top

Postby Bernhard J. M. Grün » Thu Mar 02, 2006 11:42 pm

This is another small patch that fixes my mistake.

Code: Select all
Index: pfcclient.js.tpl.php
===================================================================
--- pfcclient.js.tpl.php   (Revision 336)
+++ pfcclient.js.tpl.php   (Arbeitskopie)
@@ -779,6 +781,7 @@
   {
     var content = $('<?php echo $prefix; ?>smileys');
     var btn = $('<?php echo $prefix; ?>showHideSmileysbtn');
+    if (!btn) return;
     if (this.showsmileys)
     {
       btn.src = "<?php echo $c->getFileUrlFromTheme('images/smiley-on.gif'); ?>";
@@ -818,7 +821,7 @@
   {
     var content = $('<?php echo $prefix; ?>online');
     var btn = $('<?php echo $prefix; ?>showHideWhosOnlineBtn');
-   
+    if (!btn) return;
     if (this.showwhosonline)
     {
       btn.src = "<?php echo $c->getFileUrlFromTheme('images/online-on.gif'); ?>";

To patch that file do the following:
copy/paste your patch into phpfreechat/trunk/themes/default/templates
cd phpfreechat/trunk/themes/default/templates
patch -p0 < patch.txt

Sorry for your additional work. :(
Bernhard J. M. Grün
Member
 
Posts: 13
Joined: Thu Feb 23, 2006 3:42 pm
Location: Püttlingen, Saarland, Germany
  • Website
  • ICQ
Top

Postby phpfreechat » Fri Mar 03, 2006 9:45 am

Thank you, I just integrated your patch
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
5 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 9 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub