Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 09:04 pm EST

Geeklog Forums

GL 1.3.12 and journal comments


Status: offline

scroff

Forum User
Regular Poster
Registered: 02/19/03
Posts: 111
I updated to the CVS 1.3.12 and everything is working well, except the Journal plugin comments. The Journal has been buggy since I installed it but nothing serious, it has been working well enough. At this point I can't even say which version of the journal I have because it's a little of TheMikes and a little of the original and a little of Dirks's... but it was working.

After the upgrade Journal comments aren't appearing. They aren't saved in the db and no error shows up in the GL error log or the server error log.

I think it has to do with the new comments.php, which looks entirely different. It seems to my php ignernt mind that comments are handled differently than they were, could it be that journal comments aren't supported?

Any ideas where to start would be greatly appreciated...


*edit*

Ok, (I hate when I do this, not enough confidence in my own brain). Doh! - that was a mistake

Journal comments aren't saved because, I think, the code snippet is missing for journals in comments.php.

This bit of code...
Text Formatted Code
        case 'poll':
            $commentcode = DB_getItem ($_TABLES['pollquestions'], 'commentcode',
                                       "qid = '$sid'");
            if ($commentcode < 0) {
                return COM_refresh ($_CONF['site_url'] . '/index.php');
            }

            $ret = CMT_saveComment (strip_tags ($_POST['title']),
                $_POST['comment'], $sid, COM_applyFilter ($_POST['pid'], true),
                'poll', COM_applyFilter ($_POST['postmode']));

            if ( $ret > 0 ) { // failure
                $display .= COM_siteHeader()
                    . CMT_commentform ($uid, $title, $comment, $sid, $pid,
                            $type, $LANG03[14], $postmode)
                    . COM_siteFooter();
            } else { // success
                $display = COM_refresh ($_CONF['site_url']
                    . "/pollbooth.php?qid=$sid&aid=-1");
            }
            break;


 


handles the comments for polls, there is another bit of code for articles. When I copied and pasted this segment and swapped 'polls' for 'journals' the comments appeared. Now I just need to figure out how to get them to appear under "What's New" for new journal comments and for the page to refresh to the journal rather than to the polls. Any help in this area would be appreciated.


*second edit*

I know, you guys hate guys like me... Leaves me speechless

I'm not sure why what I did seems to be working, but here's the edit I did to the above snippet of code from comment.php to make the journal comments work again. I know to you coding gods it's rather simple, but to me it was like discovering E=MC 2

Text Formatted Code
        case 'journal':
            $commentcode = DB_getItem ($_TABLES['journal_entry'],
                                       "je_id = '$sid'");
            if ($commentcode < 0) {
                return COM_refresh ($_CONF['site_url'] . '/index.php');
            }

            $ret = CMT_saveComment (strip_tags ($_POST['title']),
                $_POST['comment'], $sid, COM_applyFilter ($_POST['je_id'], true),
                'journal', COM_applyFilter ($_POST['postmode']));

            if ( $ret > 0 ) { // failure
                $display .= COM_siteHeader()
                    . CMT_commentform ($uid, $title, $comment, $sid, $pid,
                            $type, $LANG03[14], $postmode)
                    . COM_siteFooter();
            } else { // success
                $display = COM_refresh ($_CONF['site_url']
                    . "/journal/index.php?je_id=$sid");
            }

 
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The comment API is about to change in 1.3.12, therefore no plugin that uses the current API will work with 1.3.12. This is still somewhat work in progress and Vinny and Blaine will be working out the remaining kinks before the release. So expect further changes here ...

bye, Dirk
 Quote

Status: offline

vinny

Site Admin
Admin
Registered: 06/24/02
Posts: 352
Location:Colorado, USA
We were forced to break the comment plugin API because of some usability concerns, which coupled with maintainability issues and incompaitibility with the core comment engine (in articles) lead to the decision to make the change. Unfortunately this means that existing plugins that use the comment API will have to be upgraded to support the new API. Blaine is working on an example upgrade (for the Filemgmt plugin I believe) and documentation is in the works to make this as painless as possible.

-Vinny
 Quote

Status: offline

zaurav

Forum User
Chatty
Registered: 01/07/06
Posts: 57
blank
I'm using 1.4.0.
Its great and everything cept i got the same problem. Journal comments! Could anyone post their new comment.php out here? I really need to get my comment feature online. I read vinny's article bout the new comment API but it all went over my head. I copied all the example codes and replaced 'polls' with 'journal' but nothing happened.Razz. Ne advice?
thanks
 Quote

Anmm

Anonymous
For 1.4

a dirty non-db workaround will be


step 1
======

to each of the entry you make in journal add at the end

Text Formatted Code
<a href="comment.php?comment_id=subject_of_the _article" target=new>Comments</a>
 


** ENABLE SUFFICIENT HTML SO THAT THIS IS SEEN AS A LINK IN THE JOURNAL ENTRY

The comment id will be different for different entries

step 2
======

create a file named comments.dat with proper write perm and keep it where your journal/index.php is

step 3
=======

under the same location keep a file named comment.php

comment.php will be as follows :


Text Formatted Code


<?
// Settings:

// File in which the entries will be saved (requires CHMOD 666):
$comment_settings['comment_file'] = "comments.dat";

// Admin E-mail for notifications (optional):
$comment_settings['admin_email'] = "";

// Add new comments at the top or at the bottom?
$comment_settings['add_comments'] = "bottom";

// How many comments per page?
$comment_settings['comments_per_page'] = 10;

// Make links clickable:
$comment_settings['auto_link'] = true;

// Length limitations:
$comment_settings['text_maxlength'] = 500;
$comment_settings['word_maxlength'] = 50;

// If no name is entered:
$comment_settings['anonym'] = "Anonym";

// Time format:
$comment_settings['time_format'] = "%d.%m.%Y, %H:%M";

// Anker, where the comments are on your pages:
$comment_settings['anker'] = "#comments";

// replace wordwrap? (if no ""):
$comment_settings['wordwrap'] = " - ";

// Language settings:
$comment_lang['language'] =           "en";
$comment_lang['title'] =              "Comments";
$comment_lang['email_title'] =        "E-mail to [name]";
$comment_lang['hp_title'] =           "Homepage: [homepage]";
$comment_lang['no_comments_yet'] =    "No comments yet.";
$comment_lang['comments_shown'] =     "[comments] of [comments_total] comments (part [part])";
$comment_lang['previous'] =           "Previous part";
$comment_lang['next'] =               "Next part";
$comment_lang['show_all'] =           "Show all comments";
$comment_lang['add_comment'] =        "Your comment:";
$comment_lang['name'] =               "Name:";
$comment_lang['email_hp'] =           "E-mail or homepage:";
$comment_lang['ok'] =                 "OK";
$comment_lang['no_comments'] =        "No comments";
$comment_lang['one_comment'] =        "1 comment";
$comment_lang['several_comments'] =   "[comments] comments";
$comment_lang['comment_link_title'] = "Read or write comments";
$comment_lang['email_subject'] =      "Comment to [comment_to]";
$comment_lang['email_text'] =         "Comment to [comment_to] by [name]:\n\n[comment]\n\n\nLink to the comment:\n[link]";
$comment_lang['error'] =              "Error:";
$comment_lang['err_text_too_long'] =  "the text is too long ([characters] characters - maximum is [characters_max] characters)";
$comment_lang['err_word_too_long'] =  "the word [word] is too long";

// End of settings

function comment_make_link($string)
 {
  $string = ' ' . $string;
  $string = preg_replace("#(^|[\n ])([\w]+?://.*?[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\">\\2</a>", $string);
  $string = preg_replace("#(^|[\n ])((www|ftp)\.[\w\-]+\.[\w\-.\~]+(?:/[^ \"\t\n\r<]*)?)#is", "\\1<a href=\"http://\\2\">\\2</a>", $string);
  $string = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $string);
  $string = substr($string, 1);
  return $string;
 }

function count_comments($comment_id, $text=0)
 {
  global $comment_settings, $comment_lang;
  $data = file($comment_settings['comment_file']);
  $comment_total_entries = count($data);
  // count entries:
  $comment_count = 0;
  for ($i = 0; $i < $comment_total_entries; $i++)
  {
   $parts = explode("|", $data[$i]);
   if ($parts[3] == $comment_id) $comment_count++;
  }
  if ($text == 0) return $comment_count;
  else
   {
    if ($comment_count == 0) $count_text = $comment_lang['no_comments'];
    elseif ($comment_count == 1) $count_text = $comment_lang['one_comment'];
    else $count_text = str_replace("[comments]", $comment_count, $comment_lang['several_comments']);
    return $count_text;
   }
 }

if (isset($_GET['comment_id'])) $comment_id = $_GET['comment_id'];
if (isset($_POST['comment_id'])) $comment_id = $_POST['comment_id'];
if (isset($_GET['comment_popup'])) $comment_popup = $_GET['comment_popup'];
if (isset($_POST['comment_popup'])) $comment_popup = $_POST['comment_popup'];

if (empty($comment_popup) && empty($comment_id) && empty($_GET['comment_popup_link'])) $comment_id = basename($_SERVER["PHP_SELF"]);

if (isset($comment_id))
 {
  if (isset($_GET['comment_page'])) $comment_page = $_GET['comment_page']; else $comment_page = 1;

// if comment entered::
if (isset($_POST['comment_text']) && trim($_POST['comment_text']) != "")
  {
   // check posted data:
   unset($errors);
   if (strlen($_POST['comment_text']) > $comment_settings['text_maxlength']) { $err_txt_too_lng = str_replace("[characters]", strlen($_POST['comment_text']), $comment_lang['err_text_too_long']); $err_txt_too_lng = str_replace("[characters_max]", $comment_settings['text_maxlength'], $err_txt_too_lng); $errors[] = $err_txt_too_lng; }
   $text_arr = str_replace("\n", " ", $_POST['comment_text']);
   $text_arr = explode(" ",$text_arr); for ($i=0;$i<count($text_arr);$i++) { trim($text_arr[$i]); $laenge = strlen($text_arr[$i]); if ($laenge > $comment_settings['word_maxlength']) { $errors[] = str_replace("[word]", "\"".htmlentities(stripslashes(substr($text_arr[$i],0,$comment_settings['word_maxlength'])))."...\"", $comment_lang['err_word_too_long']); } }

   // look if double:
   $data = file($comment_settings['comment_file']);
   $row_count = count($data);
   for ($row = 0; $row < $row_count; $row++)
     {
      $parts = explode("|", $data[$row]);
      if ($parts[3] == $_POST['comment_id'] && urldecode($parts[4]) == trim($_POST['name']) && trim(urldecode($parts[6])) == trim($_POST['comment_text'])) { $double_entry = true; break; }
     }

   // save if no errors:
   if (empty($errors) && empty($double_entry))
    {
      $comment_text = urlencode(trim($_POST['comment_text']));
      $name = urlencode(trim($_POST['name']));
      $email_hp = trim($_POST['email_hp']);
      if (substr($email_hp,0,7) == "http://") $email_hp = substr($email_hp,7);
      $email_hp = urlencode(base64_encode($email_hp));

      $uniqid = uniqid("");
      if ($comment_settings['add_comments'] == "top")
      {
       $data = file($comment_settings['comment_file']);
       $c = count($data);
       $datei = fopen($comment_settings['comment_file'], 'w+');
       flock($datei, 2);
       fwrite($datei, $uniqid."|".time()."|".$_SERVER["REMOTE_ADDR"]."|".$_POST['comment_id']."|".$name."|".$email_hp."|".$comment_text."\n");
       for ($i = 0; $i < $c; $i++) { fwrite($datei, trim($data[$i])."\n"); }
       flock($datei, 3);
       fclose($datei);
      }
      else
      {
       $datei = fopen($comment_settings['comment_file'], "a");
       flock($datei, 2);
       fwrite($datei, $uniqid."|".time()."|".$_SERVER["REMOTE_ADDR"]."|".$_POST['comment_id']."|".$name."|".$email_hp."|".$comment_text."\n");
       flock($datei, 3);
       fclose($datei);
      }

     // E-mail notification to admin:
     if (isset($comment_settings['admin_email']) && $comment_settings['admin_email'] !="")
      {
       if (isset($comment_popup)) { $acid1="?comment_id=".$comment_id."&ampcomment_popup=true"; $acid2="&comment_id=".$comment_id."&comment_popup=true"; } else { $acid1 = ""; $acid2 = ""; }
       $sender_name = trim($_POST['name']);
       if ($sender_name=="") $sender_name = $comment_settings['anonym'];
       if (preg_match("/^[^@]+@.+\.\D{2,5}$/", base64_decode(urldecode($email_hp)))) $sender_email = base64_decode(urldecode($email_hp)); else $sender_email = "no@email.xx";
       $comment_subject = str_replace("[comment_to]", $_POST['comment_id'], $comment_lang['email_subject']);
       $comment_email_text = str_replace("[comment_to]",$_POST['comment_id'],$comment_lang['email_text']);
       $comment_email_text = str_replace("[name]",stripslashes($sender_name),$comment_email_text);
       $comment_email_text = str_replace("[comment]",stripslashes($_POST['comment_text']),$comment_email_text);
       $emailbody = str_replace("[link]","http://".$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'].$acid1.$comment_settings['anker'],$comment_email_text);
       $header= "From: ".stripslashes($sender_name)." <".stripslashes($sender_email).">\n";
       $header .= "X-Mailer: PHP/" . phpversion(). "\n";
       $header .= "X-Sender-IP: ".$_SERVER["REMOTE_ADDR"]."\n";
       $header .= "Content-Type: text/plain";
       @mail($comment_settings['admin_email'], $comment_subject, $emailbody, $header);
      }
     }
   }

  // count:
  $data = file($comment_settings['comment_file']);
  $comment_total_entries = count($data);
  $comment_count = count_comments($comment_id);

  // Header for popup window:
  if (isset($comment_popup))
   {
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $comment_lang['language']; ?>"><head><title><?php echo $comment_lang['title']; ?></title><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><style type="text/css"><!-- body { color: #000000; background: #ffffff; margin: 15px; padding: 0px; font-family: verdana, arial, sans-serif; font-size: 13px; } p { font-family: verdana, arial, sans-serif; font-size: 13px; line-height: 19px; } h1 { font-family: verdana, arial, sans-serif; font-size: 18px; font-weight: bold; } --></style></head><body><h1><?php echo $comment_lang['title']; ?></h1><?php
   }

  // show comments:
  if (isset($_GET['show_comments'])) $show_comments = $_GET['show_comments'];
  if (isset($_POST['show_comments'])) $show_comments = $_POST['show_comments'];
  if (isset($show_comments) && isset($hide_comments)) unset($hide_comments);
  if (empty($hide_comments))
  {
  $comment_k = 0;
  $comment_a = 0;
  for ($i = 0; $i < $comment_total_entries; $i++)
    {
     $parts = explode("|", $data[$i]);
     if ($parts[3] == $comment_id)
      {
       $comment_k++;
       if ($parts[4] != "") $name = htmlentities(stripslashes(urldecode($parts[4]))); else $name = $comment_settings['anonym'];
       if ($parts[5] != "")
        {
         $email_hp = htmlentities(stripslashes(base64_decode(urldecode($parts[5]))));
         if (preg_match("/^[^@]+@.+\.\D{2,5}$/", $email_hp))
             {
              $email_parts = explode("@", $email_hp);
              $email_name = $email_parts[0];
              $email_domain_tld = $email_parts[1];
              $domain_parts = explode(".", $email_domain_tld);
              $email_domain = "";
              for ($x = 0; $x < count($domain_parts)-1; $x++)
               {
                $email_domain .= $domain_parts[$x].".";
               }
              $email_tld = $domain_parts[$x];
              $email_title = str_replace("[name]",$name,$comment_lang['email_title']);
              $name = "<script type=\"text/javascript\">
              <!--
              document.write('<a href=\"mailto:');
              document.write('".$email_name."');
              document.write('@');
              document.write('".$email_domain."');
              document.write('".$email_tld."');
              document.write('\" title=\"".$email_title."\">');
              //-->
              </script>".$name."<script type=\"text/javascript\">
              <!--
              document.write('</a>');
              //-->
              </script>";
             }
          else
          {
           $hp_title = str_replace("[homepage]",$email_hp,$comment_lang['hp_title']);
           if (isset($comment_popup)) $name = '<a href="http://'.$email_hp.'" title="'.$hp_title.'" target="_blank">'.$name.'</a>';
           else $name = '<a href="http://'.$email_hp.'" title="'.$hp_title.'">'.$name.'</a>';
          }
        }
       $comment = htmlentities(stripslashes(urldecode($parts[6])));
       if (isset($comment_settings['wordwrap']) && $comment_settings['wordwrap'] != "") $comment = str_replace("\n", $comment_settings['wordwrap'], trim($comment));
       if (isset($comment_settings['auto_link']) && $comment_settings['auto_link']==true) $comment = comment_make_link($comment);
       $zeit = $parts[1];

       if ($comment_settings['add_comments'] == "top")
        {
         if ($comment_page=="show_all" || ($comment_k>($comment_page-1)*$comment_settings['comments_per_page'] && $comment_k<$comment_page*$comment_settings['comments_per_page']+1)) { ?><p style="margin:0px 0px 5px 0px;"><b><?php echo $name; ?>:</b> <?php echo $comment; ?><span style="font-size: 10px; color: #808080;">(<?php echo strftime($comment_settings['time_format'], $parts[1]); ?>)</span></p><?php $comment_a++; }
        }
       else
        {
         if ($comment_page=="show_all" || ($comment_k > ( ($comment_count-$comment_settings['comments_per_page']) - ( ($comment_page-1) * $comment_settings['comments_per_page'] ) ) && $comment_k < (($comment_count-$comment_settings['comments_per_page'])-(($comment_page-1)*$comment_settings['comments_per_page']))+($comment_settings['comments_per_page']+1))) { ?><p style="margin:0px 0px 5px 0px;"><b><?php echo $name; ?>:</b> <?php echo $comment; ?><span style="font-size: 10px; color: #808080;">(<?php echo strftime($comment_settings['time_format'], $parts[1]); ?>)</span></p><?php $comment_a++; }
        }
      }
    }

 $comments_shown = str_replace("[comments]", $comment_a, $comment_lang['comments_shown']);
 $comments_shown = str_replace("[comments_total]", $comment_count, $comments_shown);
 $comments_shown = str_replace("[part]", $comment_page, $comments_shown);
 if ($comment_k == 0) echo "<p><i>".$comment_lang['no_comments_yet']."</i></p>";
 if ($comment_settings['comments_per_page'] < $comment_count && $comment_page != "show_all") { ?><p style="margin:10px 0px 3px 0px; font-family: verdana, arial, sans-serif; font-size: 11px;"><?php echo $comments_shown; ?> <?php
 if ($comment_settings['comments_per_page'] < $comment_count && $comment_page > 1) { ?>[ <a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?comment_id=<?php echo $comment_id; ?>&comment_page=<?php echo $comment_page-1; if (isset($comment_popup)) echo "&comment_popup=true"; if (isset($show_comments)) echo "&show_comments=true"; echo $comment_settings['anker']; ?>" title="<?php echo $comment_lang['previous']; ?>">«</a> ] <?php }
 if ($comment_settings['comments_per_page'] < $comment_count && $comment_page < (($comment_count/$comment_settings['comments_per_page']))) { ?>[ <a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?comment_id=<?php echo $comment_id; ?>&comment_page=<?php echo $comment_page+1; if (isset($comment_popup)) echo "&comment_popup=true"; if (isset($show_comments)) echo "&show_comments=true"; echo $comment_settings['anker']; ?>" title="<?php echo $comment_lang['next']; ?>">»</a> ] <?php }
 ?>
 [ <a href="<?php echo basename($_SERVER["PHP_SELF"]); ?>?comment_id=<?php echo $comment_id; ?>&comment_page=show_all<?php if (isset($comment_popup)) echo "&comment_popup=true"; if (isset($show_comments)) echo "&show_comments=true"; echo $comment_settings['anker']; ?>" title="<?php echo $comment_lang['show_all']; ?>">*</a> ]</p><?php }
 if(isset($errors))
  {
   ?><p style="color:red; font-weight:bold;"><?php echo $comment_lang['error']; ?></p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><?php
  }
 ?>
 <form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>"><div>
 <?php if (isset($comment_popup)) { ?><input type="hidden" name="comment_popup" value="true" /><?php } ?>
 <input type="hidden" name="comment_id" value="<?php echo $comment_id; ?>" />
 <input type="hidden" name="show_comments" value="true" />
 <table style="margin-top: 10px;" border="0" cellpadding="1" cellspacing="0">
  <tr>
   <td colspan="3">
   <b><?php echo $comment_lang['add_comment']; ?></b>
   <textarea style="width: 400px;" name="comment_text" cols="45" rows="4"><?php if (isset($errors) && isset($_POST['comment_text'])) echo htmlentities(stripslashes($_POST['comment_text'])); ?></textarea>
   </td>
  </tr>
  <tr>
   <td style="font-family: verdana, arial, sans-serif; font-size: 11px; vertical-align: bottom;"><?php echo $comment_lang['name']; ?><input type="text" name="name" value="<?php if (isset($errors) && isset($_POST['name'])) echo htmlentities(stripslashes($_POST['name'])); else echo ""; ?>" size="23" maxlength="25" /></td>
   <td style="font-family: verdana, arial, sans-serif; font-size: 11px; vertical-align: bottom;"><?php echo $comment_lang['email_hp']; ?><br/><input type="text" name="email_hp" value="<?php if (isset($errors) && isset($_POST['email_hp'])) echo htmlentities(stripslashes($_POST['email_hp'])); else echo ""; ?>" size="23" maxlength="60" /></td>
   <td style="font-family: verdana, arial, sans-serif; font-size: 11px; vertical-align: bottom;"><input type="submit" value="  <?php echo $comment_lang['ok']; ?>  " /></td>
  </tr>
 </table>
 </div></form>
   <?php
 }
 else
 {

  ?><p>[ <a href="<?php echo basename($_SERVER['PHP_SELF']); ?>?show_comments=true<?php echo $comment_settings['anker']; ?>" title="<?php echo $comment_lang['comment_link_title']; ?>"><?php echo count_comments($comment_id, 1); ?></a> ]</p>
  <?php
 }
 // Footer for popup window:
 if (isset($comment_popup))
  {
   ?></body></html><?php
  }
}
// JavaScript for popup window and link:
if (isset($_GET['comment_popup_link']))
 {
 ?>function comment(id)
 {
 var page = "<?php echo $_SERVER['PHP_SELF']; ?>?comment_id=" + id + "&comment_popup=true";
 popwin = window.open(page,"","width=460,height=500,scrollbars,resizable")
 popwin.focus();
 }
 document.open();
 document.write("[ <a href=\"javascript:comment('<?php echo $_GET['comment_popup_link']; ?>')\" title=\"<?php echo $comment_lang['comment_link_title']; ?>\"><?php echo count_comments($_GET['comment_popup_link'], 1); ?></a> ]");
 document.close();
 <?php
 }
?>

 
 Quote

Status: offline

zaurav

Forum User
Chatty
Registered: 01/07/06
Posts: 57
Anmm, I have yet to try that out but 1st a couple of questions. Can't i edit some file so that I dont necesarily have to put
Text Formatted Code
 <a href="comment.php?comment_id=subject_of_the _article" target=new>Comments</a>

 
?
I, personally, have no objection to using this method to work around the db and storing comments in comments.dat but for all other 200+ users on my system to do that after each journal would be kind of bothersome. Do you think I could somehow manage this without going through the href?
All I need is the correct code for the journal plugin to use the new comment API. Right now I am trying to install the journal plugin 0.2 found in the cvs repo at fglplugins(sp?).
I will however for the moment use your suggestion till a better hack comes out.
Another concern for me is that I want to back up the journals my members have. So that when I install the new version the old entries wont get deleted. any way I can do this? should I just copy the journal table or smth?
thanks

edit: I'm using gl 1.4.0
 Quote

Anmm

Anonymous
Zaurav, I am sorry, if you have already many entries and many comments this is NOT a good solution at all !! Moreover you have to add proper header and footer files to the comments.php ( not the comments.php of GL ) to integrate with the looks of your site.

This could have been a workaround for fresh installs and fresgh starters of 1.4 ..... not a very happy soloution though Sad

Can you kindly provide the link of journal plugin .2

I installed today GL 1.4 and the journal 12 - and it seems there is no easy way to make it work for 1.4 as things have changed quite a lot.
 Quote

Status: offline

zaurav

Forum User
Chatty
Registered: 01/07/06
Posts: 57
brainy
hey anmm (and nomood) bro! i got it working! well almost. I need your help for the last (a bit technical - coding) part. I installed the alternative journal version taken from the CVS repo at sourceforge. Before that I copied gl_journal, gl_journal_entry and gl_journal_type tables as backup. Then I uploaded the updated files to their respective folders on my server (before that I deleted the journal plugin from the plugin admin page and disabled my journal block)
I did install.php and everything installled fine. I checked the new tables and in gl_journal and gl_journal_entry there were a couple of new rows, so I added that to my backup tables(turns out the new rows are there for rss feed on/off and ping stuff), then I renamed the backup tables back to original and voila! I had it working. It even had neat stuff like more moods and rss feed and ping options. It even shows you new journal comments under the whats new block.
So all in all I was very satisfied with the install, then I ran into problems. It seems that for comments already posted before my gl 1.4.0 update, it uses the index.php in /public_html/journal folder whereas for post new comment link it uses /public_html/comment.php file. (i suck at explaining stuff like thisRazz).
What I'm trying to get at is that *something* is missing in comment.php because when I try to post new comment i Get to the preview page and then when I add my comment and title and press preview the thing blinks and momentarily im back at the preview page then im taken to my homepage(index.php).
Also if the comments are nested then I cannot view the nested replies cuzz when I click on it i get sql error which looks like :
Text Formatted Code
You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT jrn_uid FROM gl_journal WHERE jrn_id =  

 

Anyone got ne ideas whass wrong?
btw if you need the journal 0.2 let me know. Or Maybe we can get it posted on this site (if Dirks says ok)?
bye,



edit:

Ok so I used that snippet of code in the 1st message on this topic and When i tried posting a comment here's what I got after pressing preview button (im talking bout journal comment)
Text Formatted Code
display; ?>  $title = DB_getItem ($_TABLES['stories'], 'title', "sid = '{$sid}'" . COM_getPermSQL('AND') . COM_getTopicSQL('AND')); } $title = str_replace ('$', '$', $title); // CMT_commentForm expects non-htmlspecial chars for title... $title = str_replace ( '&', '&', $title ); $title = str_replace ( '"', '"', $title ); $title = str_replace ( '<', '<', $title ); $title = str_replace ( '>', '>', $title ); } $display .= COM_siteHeader('menu', $LANG03[1]) . CMT_commentForm ($title, '', $sid, COM_applyFilter ($_REQUEST['pid'], true), $type, COM_applyFilter ($_REQUEST['mode']), COM_applyFilter ($_REQUEST['postmode'])) . COM_siteFooter(); } else { $display .= COM_refresh($_CONF['site_url'] . '/index.php'); } break; } echo $display; ?> display; ?>
 

??
 Quote

Anmm

Anonymous
Buddy, you made a long post Smile I have to go thru it with some time in hand
I guess you are near a solution - did you give the link to the latest journal plug in .....

Please hold for a few hours as i have to rush to a doc with my mother who is sick ....

Coming back and checking things ... in the meanwhile if Dirk or anyone has some solution it will be good for us all
 Quote

Status: offline

zaurav

Forum User
Chatty
Registered: 01/07/06
Posts: 57
sneezy
Hurray! I got the journal and its comments working like new. What did i do? all of the above and then disable fck from config.php and it was working flawlessly.
Well almost flawlessly! the only thing buggy is that when I try to view public journals then it only shows mine. even in admin mode. But in journal block i can view everyone's public journal entries. Is this a bug?
 Quote

Status: offline

zaurav

Forum User
Chatty
Registered: 01/07/06
Posts: 57
When I try to view comment (threaded ones only) I get this error :
Text Formatted Code
 Fri 03 Mar 2006 04:16:39 GMT+6 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT count(*) as count FROM gl_journal WHERE jrn_uid =  
Fri 03 Mar 2006 07:39:11 GMT+6 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT jrn_uid FROM gl_journal WHERE jrn_id =  
Fri 03 Mar 2006 08:52:06 GMT+6 - 1064: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. SQL in question: SELECT jrn_uid FROM gl_journal WHERE jrn_id =
 

any help givers?
 Quote

All times are EST. The time is now 09:04 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content