[geeklog-cvs] geeklog: bug 1096

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Mar 27 15:38:01 EDT 2010


changeset 7848:2f957be083f0
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/2f957be083f0
user: vladv
date: Fri Mar 26 01:14:44 2010 +0200
description:
bug 1096

diffstat:

 plugins/staticpages/functions.inc                         |  14 ++++++++++++--
 plugins/staticpages/language/english.php                  |   1 +
 plugins/staticpages/services.inc.php                      |  13 +++++++++----
 plugins/staticpages/sql/mysql_install.php                 |   1 +
 plugins/staticpages/templates/admin/editor.thtml          |   4 ++++
 plugins/staticpages/templates/admin/editor_advanced.thtml |   4 ++++
 public_html/admin/plugins/staticpages/index.php           |  15 +++++++++++++--
 7 files changed, 44 insertions(+), 8 deletions(-)

diffs (230 lines):

diff -r b75f38deef74 -r 2f957be083f0 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Sat Mar 27 17:48:50 2010 +0100
+++ b/plugins/staticpages/functions.inc	Fri Mar 26 01:14:44 2010 +0200
@@ -293,12 +293,16 @@
         $meta_keywords = $A['meta_keywords'];
         $headercode .= COM_createMetaTags($meta_description, $meta_keywords);
     }
+    $page_title = $A['sp_page_title'];
+    if(empty($page_title)) {
+        $page_title = $A['sp_title'];
+    }
 
     if ($A['sp_format'] == 'allblocks' OR $A['sp_format'] == 'leftblocks') {
-        $retval .= COM_siteHeader('menu', $A['sp_title'], $headercode);
+        $retval .= COM_siteHeader('menu', $page_title, $headercode);
     } else {
         if ($A['sp_format'] <> 'blankpage') {
-            $retval .= COM_siteHeader('none', $A['sp_title'], $headercode);
+            $retval .= COM_siteHeader('none', $page_title, $headercode);
         }
     }
     if ($msg > 0) {
@@ -1635,6 +1639,9 @@
         case 'title':
             $fields[] = 'sp_title';
             break;
+        case 'page_title':
+            $fields[] = 'sp_page_title';
+            break; 
         case 'url':
             // needed for $sp_id == '*', but also in case we're only requesting
             // the URL (so that $fields isn't emtpy)
@@ -1694,6 +1701,9 @@
             case 'title':
                 $props['title'] = stripslashes($A['sp_title']);
                 break;
+            case 'page_title':
+                $props['page_title'] = stripslashes($A['sp_page_title']);
+                break;
             case 'url':
                 if (empty($A['sp_id'])) {
                     $props['url'] = COM_buildUrl($_CONF['site_url']
diff -r b75f38deef74 -r 2f957be083f0 plugins/staticpages/language/english.php
--- a/plugins/staticpages/language/english.php	Sat Mar 27 17:48:50 2010 +0100
+++ b/plugins/staticpages/language/english.php	Fri Mar 26 01:14:44 2010 +0200
@@ -40,6 +40,7 @@
     'writtenby' => 'Written By',
     'date' => 'Last Updated',
     'title' => 'Title',
+    'page_title' => 'Page Title',
     'content' => 'Content',
     'hits' => 'Hits',
     'staticpagelist' => 'Static Page List',
diff -r b75f38deef74 -r 2f957be083f0 plugins/staticpages/services.inc.php
--- a/plugins/staticpages/services.inc.php	Sat Mar 27 17:48:50 2010 +0100
+++ b/plugins/staticpages/services.inc.php	Fri Mar 26 01:14:44 2010 +0200
@@ -237,6 +237,7 @@
 
     $sp_id = $args['sp_id'];
     $sp_title = $args['sp_title'];
+    $sp_page_title = $args['sp_page_title'];
     $sp_content = $args['sp_content'];
     $sp_hits = $args['sp_hits'];
     $sp_format = $args['sp_format'];
@@ -350,6 +351,7 @@
             $sp_content = COM_checkHTML($sp_content, 'staticpages.edit');
         }
         $sp_title = strip_tags ($sp_title);
+        $sp_page_title = strip_tags ($sp_page_title);
         $sp_label = strip_tags ($sp_label);
 
         $meta_description = strip_tags ($meta_description);
@@ -357,6 +359,7 @@
 
         $sp_content = addslashes ($sp_content);
         $sp_title = addslashes ($sp_title);
+        $sp_page_title = addslashes ($sp_page_title);
         $sp_label = addslashes ($sp_label);
         $meta_description = addslashes ($meta_description);
         $meta_keywords = addslashes ($meta_keywords);        
@@ -401,9 +404,9 @@
             $datecreated = date('Y-m-d H:i:s');
         }
         
-        DB_save($_TABLES['staticpage'], 'sp_id,sp_title,sp_content,created,modified,sp_hits,sp_format,sp_onmenu,sp_label,commentcode,meta_description,meta_keywords,draft_flag,owner_id,group_id,'
+        DB_save($_TABLES['staticpage'], 'sp_id,sp_title,sp_page_title, sp_content,created,modified,sp_hits,sp_format,sp_onmenu,sp_label,commentcode,meta_description,meta_keywords,draft_flag,owner_id,group_id,'
                 .'perm_owner,perm_group,perm_members,perm_anon,sp_php,sp_nf,sp_centerblock,sp_help,sp_tid,sp_where,sp_inblock,postmode',
-                "'$sp_id','$sp_title','$sp_content','$datecreated',NOW(),$sp_hits,'$sp_format',$sp_onmenu,'$sp_label','$commentcode','$meta_description','$meta_keywords',$draft_flag,$owner_id,$group_id,"
+                "'$sp_id','$sp_title','$sp_page_title','$sp_content','$datecreated',NOW(),$sp_hits,'$sp_format',$sp_onmenu,'$sp_label','$commentcode','$meta_description','$meta_keywords',$draft_flag,$owner_id,$group_id,"
                         ."$perm_owner,$perm_group,$perm_members,$perm_anon,'$sp_php','$sp_nf',$sp_centerblock,'$sp_help','$sp_tid',$sp_where,"
                         ."'$sp_inblock','$postmode'");
 
@@ -565,7 +568,7 @@
             $perms = ' AND ' . $perms;
         }
         $sql = array();
-        $sql['mysql'] = "SELECT sp_title,sp_content,sp_hits,created,modified,sp_format,"
+        $sql['mysql'] = "SELECT sp_title,sp_page_title,sp_content,sp_hits,created,modified,sp_format,"
                       . "commentcode,meta_description,meta_keywords,draft_flag,"
                       . "owner_id,group_id,perm_owner,perm_group,"
                       . "perm_members,perm_anon,sp_tid,sp_help,sp_php,"
@@ -655,6 +658,7 @@
             $output['updated']      = date('c', strtotime($output['modified']));
             $output['id']           = $page;
             $output['title']        = $output['sp_title'];
+            $output['page_title']   = $output['sp_page_title'];
             $output['category']     = array($output['sp_tid']);
             $output['content']      = $output['sp_content'];
             $output['content_type'] = 'html';
@@ -687,7 +691,7 @@
         $limit = " LIMIT $offset, $max_items";
         $order = " ORDER BY modified DESC";
         $sql = array();
-        $sql['mysql'] = "SELECT sp_id,sp_title,sp_content,sp_hits,created,modified,sp_format,meta_description,meta_keywords,draft_flag,owner_id,"
+        $sql['mysql'] = "SELECT sp_id,sp_title,sp_page_title,sp_content,sp_hits,created,modified,sp_format,meta_description,meta_keywords,draft_flag,owner_id,"
                 ."group_id,perm_owner,perm_group,perm_members,perm_anon,sp_tid,sp_help,sp_php,"
                 ."sp_inblock FROM {$_TABLES['staticpage']}" . $perms . $order . $limit;
         $sql['mssql'] = "SELECT sp_id,sp_title,CAST(sp_content AS text) AS sp_content,sp_hits,"
@@ -712,6 +716,7 @@
                 $output_item['updated']      = date('c', strtotime($output_item['modified']));
                 $output_item['id']           = $output_item['sp_id'];
                 $output_item['title']        = $output_item['sp_title'];
+                $output_item['page_title']   = $output_item['sp_page_title'];
                 $output_item['category']     = array($output_item['sp_tid']);
                 $output_item['content']      = $output_item['sp_content'];
                 $output_item['content_type'] = 'html';
diff -r b75f38deef74 -r 2f957be083f0 plugins/staticpages/sql/mysql_install.php
--- a/plugins/staticpages/sql/mysql_install.php	Sat Mar 27 17:48:50 2010 +0100
+++ b/plugins/staticpages/sql/mysql_install.php	Fri Mar 26 01:14:44 2010 +0200
@@ -39,6 +39,7 @@
 CREATE TABLE {$_TABLES['staticpage']} (
   sp_id varchar(40) NOT NULL default '',
   sp_title varchar(128) NOT NULL default '',
+  sp_page_title varchar(128) NOT NULL default '',
   sp_content text NOT NULL,
   sp_hits mediumint(8) unsigned NOT NULL default '0',
   `created` datetime NOT NULL default '0000-00-00 00:00:00',
diff -r b75f38deef74 -r 2f957be083f0 plugins/staticpages/templates/admin/editor.thtml
--- a/plugins/staticpages/templates/admin/editor.thtml	Sat Mar 27 17:48:50 2010 +0100
+++ b/plugins/staticpages/templates/admin/editor.thtml	Fri Mar 26 01:14:44 2010 +0200
@@ -6,6 +6,10 @@
               <td><input type="text" size="48" maxlength="255" name="sp_title" value="{sp_title}"{xhtml}></td>
           </tr>
           <tr>
+              <td align="right">{lang_page_title}:</td>
+              <td><input type="text" size="48" maxlength="255" name="sp_page_title" value="{sp_page_title}"{xhtml}></td>
+          </tr>  
+          <tr>
               <td align="right">{lang_addtomenu}:</td>
               <td>
                   <input type="checkbox" name="sp_onmenu" {onmenu_checked}{xhtml}>  {lang_label}:
diff -r b75f38deef74 -r 2f957be083f0 plugins/staticpages/templates/admin/editor_advanced.thtml
--- a/plugins/staticpages/templates/admin/editor_advanced.thtml	Sat Mar 27 17:48:50 2010 +0100
+++ b/plugins/staticpages/templates/admin/editor_advanced.thtml	Fri Mar 26 01:14:44 2010 +0200
@@ -16,6 +16,10 @@
               <td><input type="text" size="48" maxlength="255" name="sp_title" value="{sp_title}"{xhtml}></td>
           </tr>
           <tr>
+              <td align="right">{lang_title}:</td>
+              <td><input type="text" size="48" maxlength="255" name="sp_title" value="{sp_title}"{xhtml}></td>
+          </tr> 
+          <tr>
               <td align="right">{lang_addtomenu}:</td>
               <td>
                   <input type="checkbox" name="sp_onmenu" {onmenu_checked}{xhtml}>  {lang_label}:
diff -r b75f38deef74 -r 2f957be083f0 public_html/admin/plugins/staticpages/index.php
--- a/public_html/admin/plugins/staticpages/index.php	Sat Mar 27 17:48:50 2010 +0100
+++ b/public_html/admin/plugins/staticpages/index.php	Fri Mar 26 01:14:44 2010 +0200
@@ -346,11 +346,17 @@
     $sp_template->set_var('sp_date', $curtime[1]);
 
     $sp_template->set_var('lang_title', $LANG_STATIC['title']);
+    $sp_template->set_var('lang_page_title', $LANG_STATIC['page_title']);
     $title = '';
+    $page_title = '';
     if (isset($A['sp_title'])) {
         $title = htmlspecialchars(stripslashes($A['sp_title']));
     }
+    if (isset($A['sp_page_title'])) {
+        $page_title = htmlspecialchars(stripslashes($A['sp_page_title']));
+    }
     $sp_template->set_var('sp_title', $title);
+    $sp_template->set_var('sp_page_title', $page_title);
     $sp_template->set_var('lang_metadescription',
                           $LANG_ADMIN['meta_description']);
     $sp_template->set_var('lang_metakeywords', $LANG_ADMIN['meta_keywords']);
@@ -608,6 +614,9 @@
         if (isset($A['sp_title'])) {
             $A['sp_title'] = strip_tags($A['sp_title']);
         }
+        if (isset($A['sp_page_title'])) {
+            $A['sp_page_title'] = strip_tags($A['sp_page_title']);
+        }
         if (isset($A['meta_description'])) {
             $A['meta_description'] = strip_tags($A['meta_description']);
         }
@@ -633,6 +642,7 @@
 *
 * @param string sp_id            ID of static page
 * @param string sp_title         title of page
+* @param string sp_page_title    page title of the staticpage
 * @param string sp_content       page content
 * @param int    sp_hits          Number of page views
 * @param string sp_format        HTML or plain text
@@ -658,7 +668,7 @@
 * @param string draft_flag       Flag: save as draft
 *
 */
-function submitstaticpage($sp_id, $sp_title, $sp_content, $sp_hits,
+function submitstaticpage($sp_id, $sp_title,$sp_page_title, $sp_content, $sp_hits,
                           $sp_format, $sp_onmenu, $sp_label, $commentcode,
                           $owner_id, $group_id, $perm_owner, $perm_group,
                           $perm_members, $perm_anon, $sp_php, $sp_nf,
@@ -671,6 +681,7 @@
     $args = array(
                 'sp_id' => $sp_id,
                 'sp_title' => $sp_title,
+                'sp_page_title' => $sp_page_title,
                 'sp_content' => $sp_content,
                 'sp_hits' => $sp_hits,
                 'sp_format' => $sp_format,
@@ -773,7 +784,7 @@
         if (!isset($_POST['draft_flag'])) {
             $_POST['draft_flag'] = '';
         }
-        $display .= submitstaticpage($sp_id, $_POST['sp_title'],
+        $display .= submitstaticpage($sp_id, $_POST['sp_title'], $_POST['sp_page_title'],
             $_POST['sp_content'], COM_applyFilter($_POST['sp_hits'], true),
             COM_applyFilter($_POST['sp_format']), $_POST['sp_onmenu'],
             $_POST['sp_label'], COM_applyFilter($_POST['commentcode'], true),



More information about the geeklog-cvs mailing list