[pLog-svn] r4240 - in plugins/branches/lifetype-1.1/shoutbox: . class/action class/dao locale templates templates-sample/standard

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Nov 5 19:13:29 GMT 2006


Author: oscar
Date: 2006-11-05 19:13:28 +0000 (Sun, 05 Nov 2006)
New Revision: 4240

Modified:
   plugins/branches/lifetype-1.1/shoutbox/README.txt
   plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxnewshoutaction.class.php
   plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxupdateconfigaction.class.php
   plugins/branches/lifetype-1.1/shoutbox/class/dao/shoutbox.class.php
   plugins/branches/lifetype-1.1/shoutbox/locale/locale_en_UK.php
   plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/footer.template
   plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox.template
   plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox_history.template
   plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox.template
   plugins/branches/lifetype-1.1/shoutbox/templates/shoutboxConfig.template
   plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox_newshout.template
Log:
many updates to the 'shoutbox' plugin to get it to play nicely with other LT installations other than the user's own (lots of hardcoded stuff) Additionally, I've fixed several UI inconsistencies, cleaned up some code, etc. Hopefully the author won't mind, or else he shouldn't be submitting this kind of unfinished and unpolished plugins.


Modified: plugins/branches/lifetype-1.1/shoutbox/README.txt
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/README.txt	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/README.txt	2006-11-05 19:13:28 UTC (rev 4240)
@@ -62,9 +62,8 @@
 
       <h2>{$locale->tr("Shoutbox")}</h2>
         <div id="Shoutbox">
-          {include file="standard/shoutbox.template"}
+          {include file="$blogtemplate/shoutbox.template"}
         </div>  
-      </div>
       ... (continues) ...
 
 

Modified: plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxnewshoutaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxnewshoutaction.class.php	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxnewshoutaction.class.php	2006-11-05 19:13:28 UTC (rev 4240)
@@ -30,7 +30,7 @@
     }
 
     //$nickname = $this->_request->getValue('nickname');
-    $nickname = $_POST['shoutbox_nickname'];
+    $nickname = $this->_request->getValue( 'shoutbox_nickname' );
     $nickname = strip_tags($nickname);
     $protected_nicks = $s->protected_nicks;
     $protection_password = $s->protection_password;
@@ -62,7 +62,7 @@
     
   
     //$shoutText = $this->_request->getValue('shoutText');
-    $shoutText = $_POST['shoutbox_text'];
+    $shoutText = $this->_request->getValue( 'shoutbox_text' );
     $shoutText = strip_tags($shoutText, '<a><br><b><i><strong>');
     if (!get_magic_quotes_gpc()) {
         $nickname = addslashes($nickname);
@@ -102,7 +102,7 @@
     */
     
     $this->_view = new InfoView($this->_blogInfo );
-    $this->_view->setInfoMessage("shout added");
+    $this->_view->setInfoMessage("shout_added");
       
     
     $this->setCommonData();

Modified: plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxupdateconfigaction.class.php
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxupdateconfigaction.class.php	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/class/action/pluginshoutboxupdateconfigaction.class.php	2006-11-05 19:13:28 UTC (rev 4240)
@@ -68,13 +68,8 @@
             $this->_blogInfo->setSettings($blogSettings );
         
             // save the blogs settings
-            $blogs = new Blogs();
-            
-            include(PLOG_CLASS_PATH ."/version.php");
-            if(!preg_match('/lifetype-1.1/', $version))
-              $updateResult = $blogs->updateBlog($this->_blogInfo->getId(), $this->_blogInfo);
-            else
-              $updateResult = $blogs->updateBlog($this->_blogInfo);
+            $blogs = new Blogs();            
+            $updateResult = $blogs->updateBlog($this->_blogInfo);
               
             if( !$updateResult) {
                 $this->_view = new AdminErrorView( $this->_blogInfo );

Modified: plugins/branches/lifetype-1.1/shoutbox/class/dao/shoutbox.class.php
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/class/dao/shoutbox.class.php	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/class/dao/shoutbox.class.php	2006-11-05 19:13:28 UTC (rev 4240)
@@ -40,7 +40,7 @@
         $this->mail_alert = $blogSettings->getValue("plugin_shoutbox_mail_alert");
         $this->quick_delete = $blogSettings->getValue("plugin_shoutbox_quick_delete");
         $this->max_length = $blogSettings->getValue( "plugin_shoutbox_max_length");
-        $this->shouts_per_view = $blogSettings->getValue( "plugin_shoutbox_shouts_per_view");
+        $this->shouts_per_view = $blogSettings->getValue( "plugin_shoutbox_shouts_per_view", 0);
 
         $this->default_nick = $blogSettings->getValue( "plugin_shoutbox_default_nick");
         $this->default_shout = $blogSettings->getValue( "plugin_shoutbox_default_shout");
@@ -140,8 +140,9 @@
         if(!$res)
             return 0;
         $cnt = $res->FetchRow();
-        if($cnt['cnt'] > 0)
+        if($cnt['cnt'] > 0) {
             $cnt = floor($cnt['cnt'] / $this->shouts_per_view);
+		}
         return $cnt;
     }
 

Modified: plugins/branches/lifetype-1.1/shoutbox/locale/locale_en_UK.php
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/locale/locale_en_UK.php	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/locale/locale_en_UK.php	2006-11-05 19:13:28 UTC (rev 4240)
@@ -5,6 +5,7 @@
 $messages["shoutbox"] = "The Shoutbox";
 $messages["shoutbox_history"] = "Shoutbox History";
 $messages["shoutbox_disabled"] = "Shouting is temporarily disabled";
+$messages["shout"] = "Shout!";
 
 // shoutbox.template
 $messages["nickname"] = "Nickname";

Modified: plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox.template
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox.template	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox.template	2006-11-05 19:13:28 UTC (rev 4240)
@@ -15,17 +15,15 @@
 
 <FORM method="POST" onSubmit="return doConfirm()">
     <input type="hidden" name="op" value="deleteShouts" />
-
-
     <input type="hidden" name="currentPage" value="{$this->current_page}" />
     
 <table class="info">
     <thead>
         <tr>
             <!-- 775 -->
+            <th style="width:10px;"><input class="checkbox" type="checkbox" name="all" id="all" value="1" onclick="toggleAllChecks('del');" /></th>
             <th style="width:140px;">{$locale->tr("nickname")}</th>
             <th>Text</th>
-            <th style="width:10px;">{$locale->tr("select")}</th>
         </tr>
     </thead>
     
@@ -33,16 +31,17 @@
 
 {foreach from=$shouts item=shout key=shoutId}
     <tr>
+    <td><INPUT type='checkbox' name=del[{$shout.shout_id}]/></td>	
     <td>{$shout.nickname}</td>
     <td>{$shout.shout_text}</td>
-    <td><INPUT type='checkbox' name=del[{$shout.shout_id}]/></td>
     </tr>
 {/foreach}
 
 </table>
 
-<br/>
-<INPUT type="submit" name="delShouts" value="{$locale->tr("delete")} selected" onFocus="submitUsed = 'del'"/>
+<div class="buttons">
+  <INPUT type="submit" name="delShouts" value="{$locale->tr("delete")} selected" onFocus="submitUsed = 'del'"/>
+</div>
 </FORM>
 
 <br/>

Modified: plugins/branches/lifetype-1.1/shoutbox/templates/shoutboxConfig.template
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/templates/shoutboxConfig.template	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/templates/shoutboxConfig.template	2006-11-05 19:13:28 UTC (rev 4240)
@@ -11,7 +11,7 @@
         <div class="field">
         <label for="shout_enabled">Posting enabled</label>
         <div class="formHelp">
-            <input type="checkbox" id="shout_enabled" name="shout_enabled" {$shout_enabled_checked} value="12345" />
+            <input type="checkbox" id="shout_enabled" name="shout_enabled" {$shout_enabled_checked} value="12345" class="checkbox"/>
             Uncheck this if you want to temporary disable the posting. The shoutbox will still be displayed,
             but nobody will be able to add new shouts.
         </div> 
@@ -21,7 +21,7 @@
         <div class="field">
         <label for="mail_alert">Mail Alert</label>
         <div class="formHelp">
-            <input type="checkbox" id="mail_alert" name="mail_alert" {$mail_alert_checked} value="12345" />
+            <input type="checkbox" id="mail_alert" name="mail_alert" {$mail_alert_checked} value="12345"  class="checkbox"/>
             Alert me whenever a new shout is added
         </div> 
         </div>
@@ -29,7 +29,7 @@
         <div class="field">
         <label for="quick_delete">Quick delete</label>
         <div class="formHelp">
-            <input type="checkbox" id="quick_delete" name="quick_delete" {$quick_delete_checked} value="12345" />
+            <input type="checkbox" id="quick_delete" name="quick_delete" {$quick_delete_checked} value="12345"  class="checkbox"/>
             Append a link to the notification emails, which allows to immediately delete the shout.
             It works only if the Mail Alert is enabled.
         </div> 
@@ -84,8 +84,10 @@
         </div>
 </fieldset>
 
-    
-    <INPUT type="submit" name="updateOptions" value="Save options"/>
+    <div class="buttons">
+      <INPUT type="reset" name="reset" value="{$locale->tr("reset")}"/>		
+      <INPUT type="submit" name="updateOptions" value="{$locale->tr("update")}"/>
+    </div>
 </FORM>
 <br/>
 

Modified: plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox_newshout.template
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox_newshout.template	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/templates/shoutbox_newshout.template	2006-11-05 19:13:28 UTC (rev 4240)
@@ -1,13 +1,13 @@
 {assign var="mybase" value="http://localhost/linea/"}
 {assign var="mybase" value="http://www.netpalantir.it/"}
 
-{assign var="shoutbox_include" value="templates/palantir-tribal2/shoutbox.template"}
+{assign var="shoutbox_include" value="$blogtemplate/shoutbox.template"}
 
-{include file="templates/palantir-tribal2/header.template"}
+{include file="$blogtemplate/header.template"}
 
 <br><br><br>
 
 {$locale->tr("shout_added")}
 <a href="{$returnPage}">{$locale->tr("go_back")}</a>
 
-{include file="templates/palantir-tribal2/footer.template"}
\ No newline at end of file
+{include file="$blogtemplate/footer.template"}
\ No newline at end of file

Modified: plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/footer.template
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/footer.template	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/footer.template	2006-11-05 19:13:28 UTC (rev 4240)
@@ -82,7 +82,7 @@
       
     <h2>{$locale->tr("Shoutbox")}</h2>
       <div id="Shoutbox">
-        {include file="standard/shoutbox.template"}
+        {include file="$blogtemplate/shoutbox.template"}
       </div>  
 </div>
 

Modified: plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox.template
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox.template	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox.template	2006-11-05 19:13:28 UTC (rev 4240)
@@ -9,8 +9,8 @@
 {/foreach}   
 
 <p style="font-weight: bold;">
-<a href="{$smarty.server.PHP_SELF}?op=shoutboxHistory">
-Shoutbox History
+<a href="{$url->getIndexUrl()}?op=shoutboxHistory">
+{$locale->tr("shoutbox_history")}
 </a>
 </p>
 
@@ -36,13 +36,14 @@
 
 {assign var="shoutsEnabled" value=$shoutbox->isShoutboxEnabled()}
 {if $shoutsEnabled}
-<form method='post' action='index.php?op=shoutboxNewShout'>
-  <input type="hidden" name="shoutbox_return" value="{$smarty.server.PHP_SELF}" />
+<form method='post' action='{$url->getIndexUrl()}'>
+  <input type="hidden" name="shoutbox_return" value="{$url->blogLink()}" />
   <textarea name="shoutbox_text" cols="15" rows="2" onfocus="shoutbox_clearField(this)" onblur="shoutbox_resetField(this)">{$defaultShout}</textarea>
   <br />
   <input type="text" name="shoutbox_nickname" value="{$deafultNick}" size="15" onfocus="shoutbox_clearField(this)" onblur="shoutbox_resetField(this)"/>
   <br />
-  <input type="submit" name="shoutbox_submit" value="Shout!"/>
+  <input type="submit" name="shoutbox_submit" value="{$locale->tr("shout")}"/>
+  <input type="hidden" name="op" name="shoutboxNewShout">
 </form>
 <br />
 {else}

Modified: plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox_history.template
===================================================================
--- plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox_history.template	2006-11-05 17:17:59 UTC (rev 4239)
+++ plugins/branches/lifetype-1.1/shoutbox/templates-sample/standard/shoutbox_history.template	2006-11-05 19:13:28 UTC (rev 4240)
@@ -1,15 +1,15 @@
-{assign var="shoutbox_include" value="templates/palantir-tribal2/shoutbox.template"}
+{assign var="shoutbox_include" value="$blogtemplate/shoutbox.template"}
 
-{include file="standard/header.template"}
+{include file="$blogtemplate/header.template"}
 
 <h1>Shoutbox History</h1>
 
 {if $prev_page}
-<a href='{$smarty.server.PHP_SELF}?op=shoutboxHistory&page={$prev_page}'>&#171; {$locale->tr("prev_page")}</a>
+<a href='{$url->getIndexUrl()}?op=shoutboxHistory&amp;page={$prev_page}'>&#171; {$locale->tr("prev_page")}</a>
 &nbsp; &nbsp;
 {/if}
 {if $next_page}
-<a href='{$smarty.server.PHP_SELF}?op=shoutboxHistory&page={$next_page}'>{$locale->tr("next_page")} &#187;</a>
+<a href='{$url->getIndexUrl()}?op=shoutboxHistory&amp;page={$next_page}'>{$locale->tr("next_page")} &#187;</a>
 {/if}
 <br /><br />
 
@@ -21,12 +21,12 @@
 
 <p>
 {if $prev_page}
-<a href='{$smarty.server.PHP_SELF}?op=shoutboxHistory&page={$prev_page}'>&#171; {$locale->tr("prev_page")}</a>
+<a href='{$url->getIndexUrl()}?op=shoutboxHistory&amp;page={$prev_page}'>&#171; {$locale->tr("prev_page")}</a>
 &nbsp; &nbsp;
 {/if}
 {if $next_page}
-<a href='{$smarty.server.PHP_SELF}?op=shoutboxHistory&page={$next_page}'>{$locale->tr("next_page")} &#187;</a>
+<a href='{$url->getIndexUrl()}?op=shoutboxHistory&amp;page={$next_page}'>{$locale->tr("next_page")} &#187;</a>
 {/if}
 </p>
 
-{include file="standard/footer.template"}
\ No newline at end of file
+{include file="$blogtemplate/footer.template"}
\ No newline at end of file



More information about the pLog-svn mailing list