• [MOD] Per User Shouts/Guestbook V1.1 5 0 5 1
Currently:  

Author Topic: [MOD] Per User Shouts/Guestbook V1.1  (Read 54915 times)

0 Members and 1 Guest are viewing this topic.

Offline Sunny C.

  • Addicted member
  • ******
  • Posts: 1.806
  • I ♥ 4I
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #30 on: October 14, 2009, 11:57:01 PM »
Thanks Deskcom!

Offline CJS

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #31 on: March 06, 2010, 04:13:10 PM »
Sorry,

habe schon beim ersten Step der install_gd.php ein Problem:

"Sorry, can not continue, you missed some steps of the installation."

Was habe ich übersehen, das ist doch der erste Schritt zum Mod, oder?

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #32 on: March 17, 2010, 09:44:29 PM »
Hi -

Using v 1.7.7

Just installed the Shouts/Guestbook v1.1

Everything went well. Was able to make a shout and then log in and see it as the other user.

But I have the same problem that CyberAx had in his post:
http://www.4homepages.de/forum/index.php?topic=22492.msg141996#msg141996

I get "Array" in the user_logininfo.html template, and in the member_profile.html template. Also, it appears in the bottom of the page for the summary of Shouts, just like CyberAx.

[UPDATE]

CyberAx replied that he had fixed the same issue but he didn't remember how.

Suspect the problem is with the includes/page_headed.php file;

looking at the code that we should paste, I figured that perhaps I needed to specify the table in our database so changed the first line here:

from $query = "SELECT COUNT(*) FROM ".USERS_GB_TABLE."  to $query = "SELECT COUNT(*) FROM 4images_users_gb

here is current code:
//////////////////////////////////////////////
$query = "SELECT COUNT(*) FROM 4images_users_gb
          WHERE user_id_gb = ".$user_info['user_id']."
          AND user_gb_read = '0000-00-00 00:00:00'";
$erg = $site_db->query_firstrow($query);
  if($erg == "0"){$user_gb_neu = $lang['user_gb_entry']."(".$erg.")";}
  elseif($erg == "1"){$user_gb_neu = $lang['user_gb_entrys']."<b>(".$erg.")</b>";}
  elseif($erg > "1"){$user_gb_neu = $lang['user_gb_entrys']."<b>(".$erg.")</b>";}

////////////////////////////////////////////////

Still no joy. Keep getting 'Array' all over the place.  I have made two Shout posts thinking that might 'seed' the count but that didn't help.

[UPDATE - II]

I have tried every variation on the above "SELECT COUNT" query and nothing helps. I have changed the table names since our installation is in a subdirectory that has a different name than 4images. I have tried changing the field name in ".$user_info['user_id']." to the full field name from our database.

Nothing helps.  Totally stumped.  Hoping someone will be able to solve this mystery.

[UPDATE - III]

CyberAx was kind enough to send along his three files so I could compare our version of the codes for the installed MOD (since he was able to fix the same issue). His variations in the includes/page_header.php for the above query count solved half of the problem. The userbox now shows a count. Unfortunately the other code differences cause some errors in member.php and I still have the 'Array' display in the Shout counts in the member profile display.  After 4 hours of code variations and tinkering, I have to throw in the towel on this MOD, for the time being.

[UPDATE - IV]

No word from the MOD creator. Have attached a pic of the problem.

Hoping and hoping and hoping that Deskcom will respond and help me solve this issue

If anyone has any thoughts, let me know.

Cheers,

Brian
« Last Edit: March 25, 2010, 08:30:40 PM by surferboy »

Offline ghost_wizard

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #33 on: March 29, 2010, 06:47:19 PM »
Ich hoffe auch das sich hier noch was tut, denn ich kriege das teil auch nicht zum Laufen :cry:

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #34 on: March 30, 2010, 06:03:03 AM »
Hey ghostwhizard:

For the record - I HAVE NO IDEA what I am doing. I just copy and paste the code.  

With that said, I took CyberAx's IM where he provided the files he used that somehow got the system to work.

Maybe this is a glitch with v.1.7.7 or maybe not but I just played with his query code and was able to fix all three glitches in this MOD. Again, I HAVE NO IDEA why this fix works but it solved the issue for me:

For Step 6b. in the page_header.php file, use this code instead of what Dekscom tells you to paste:

//////////////////////////////////////////////
$query "SELECT COUNT(*) FROM ".USERS_GB_TABLE."
          WHERE user_id_gb = "
.$user_info['user_id']."
          AND user_gb_read = '0000-00-00 00:00:00'"
;
#  $erg = $site_db->query_firstrow($query);
 
$resultmysql_query($query) or die("Fehler");
 
$erge mysql_fetch_row($result);
 
$erg $erge[0];
  
  if(
$erg == "0"){$user_gb_neu $lang['user_gb_entry']."(".$erg.")";}
  elseif(
$erg == "1"){$user_gb_neu $lang['user_gb_entrys']."<b>(".$erg.")</b>";}
  elseif(
$erg "1"){$user_gb_neu $lang['user_gb_entrys']."<b>(".$erg.")</b>";}


////////////////////////////////////////////////


That takes care of the 'array' issue in the userbox.

Now, for the array issues in the Member control panel, paste this code in Step 5b instead of what Deskcom tells you to paste:

/////////////////////////////////////////////////////
  
$msg_del $_GET['msg_del'];
  if(
$msg_del == "yes"$msg $lang['user_gb_delete_ok'];
  elseif(
$msg_del == "no"$msg $lang['user_gb_delete_not'];
  elseif(
$msg_del == ""$msg "";

  if(
$_GET['user_id'] == ""$id $user_info[user_id]; else $id $_GET['user_id'];
  if(isset(
$id))
  {
   
$query "SELECT user_id, user_name FROM ".USERS_TABLE." WHERE user_id = ".$id."";
   
$sql $site_db->query($query);
   
$ds $site_db->fetch_object($sql);
   
$user_name "<a href='member.php?action=showprofile&user_id=".$ds->user_id."' target=_self>".$ds->user_name."</a>";
   
$user_name2 $ds->user_name;
  } else {
  
$user_name $user_info['user_name'];
  
$user_name2 $user_info['user_name'];
  }
  if(isset(
$id)) {$abf_id $id;} else {$abf_id $user_info['user_id'];}
  
$user_gb_own $lang['user_gb'].$user_name2."";
  
$query2 "SELECT COUNT(*) FROM ".USERS_GB_TABLE." WHERE user_id_gb = ".$abf_id."";
#  $erg = $site_db->query_firstrow($query2);
 
$resultmysql_query($query2) or die("Fehler");
 
$erge mysql_fetch_row($result);
 
$erg $erge[0];

  
if(
$erg == "0"){$user_gb_entry $erg.$lang['user_gb_entry'];}
  elseif(
$erg == "1"){$user_gb_entry $erg.$lang['user_gb_entrys'];}
  elseif(
$erg "1"){$user_gb_entry $erg.$lang['user_gb_entrys'];}

  
$offset = @$_GET['off'];
  if(isset(
$offset)) {$offset $_GET['off'];} else {$offset "0";}
    
$gb_query "SELECT users_gb_id,user_id_gb,user_id_ein,user_name_gb,user_gb_text,user_gb_date,DATE_FORMAT(user_gb_date,'%e.%c.%Y') AS user_gb_datum,DATE_FORMAT(user_gb_date,'%H:%i:%s') AS user_gb_uhr, user_id, user_name, user_level
                  FROM ("
.USERS_GB_TABLE." i)
                  LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id_ein)
                  WHERE user_id_gb = "
.$abf_id."
                  ORDER BY user_gb_date DESC
                  LIMIT 
$offset, 10";

  
$gb_sql $site_db->query($gb_query);

  while(
$ds $site_db->fetch_object($gb_sql))
    {

    if(
$ds->user_id_ein == $user_info[user_id] AND $ds->user_id != $ds->user_id_gb)
    {
      
$user_link_del "<a href='member.php?action=delete_entry&entry=".$ds->users_gb_id."&user_id=".$ds->user_id_gb."'>".$lang['delete']."</a>";} else {$user_link_del ="";
    }
    if(
$abf_id == $user_info[user_id])
    {
      
$user_gb_delete "<a href='member.php?action=delete_entry&entry=".$ds->users_gb_id."&user_id=".$ds->user_id_gb."'>".$lang[delete]."</a> ".$user_link_del;
    }
    else {
$user_gb_delete $user_link_del;}

    if (
$ds->user_id == "")
    {
      
$user $ds->user_name_gb;
      
$gb_link "";
      
$gender "";
    }
    else
    {
      
$user "<b><a href='member.php?action=showprofile&user_id=".$ds->user_id_ein."'>".$ds->user_name_gb."</a></b>";
      
$gb_link "<a href='member.php?action=showprofile&user_id=".$ds->user_id."'\n target=_self><img src='".TEMPLATE_PATH."/images/gb_".$config['language_dir'].".gif' border=0></a>";
    }


    
$text $ds->user_gb_text;

    
$gb_time $ds->user_gb_datum.$lang['user_gb_at'].$ds->user_gb_uhr;
    
$level $ds->user_level;
    if(
$level == "9") {$level $lang['level_admin'];}
    elseif(
$level == "2") {$level $lang['level_user'];}
    else {
$level "";}

  
$site_template->register_vars(array(
    
"user" => $user,
    
"gb_time" => $gb_time,
    
"admin_link" => $user_gb_delete,
    
"userpic" => $user_pic,
    
"gender" => $gender,
    
"gb_link" => $gb_link,
    
"level" => $level,
    
"text" => format_text($text$config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'])
    ));
  
$gb_entrys .= $site_template->parse_template("user_gb_bit");
  }

  
//Pageing
  
if($offset == 0) {$vor $lang['user_gb_prev'];}
  else
  {
    
$offset2 $offset 10;
    
$vor "<a href='member.php?action=showprofile&user_id=".$abf_id."&off=".$offset2."'>".$lang['user_gb_prev']."</a>";
  }
  
$offset3 $offset 10;
  if(
$offset3 >= $erg ) { $weiter $lang['user_gb_next'];}
  else {
$weiter "<a href='member.php?action=showprofile&user_id=".$abf_id."&off=".$offset3."'>".$lang['user_gb_next']."</a>";}
  
$gb_pageing $vor."&nbsp;".$weiter;

   
$site_template->register_vars(array(
    
"gb_entrys" => $gb_entrys,
    
"user_gb_own" => $user_gb_own,
    
"gb_pageing" => $gb_pageing,
    
"user_gb_entry" => $user_gb_entry,
    
"user_gb_entry_text" => $user_gb_entry_text
  
));

  if(
$_GET['ent'] == ""$afg "false"; else $afg $_GET['ent'];
  if (
$_POST['comment_text'] == "" $_GET['ent'] == "true")
    {
      
$msg $lang['error_no_text'];
      
$afg "false";
    }
  if(
$afg == "true")
  {
    
$text $_POST['comment_text'];
    if(
$_POST['user_id'] == $user_info[user_id]) { $a "NOW()";}
    else {
$a "'0000-00-00 00:00:0'";}
    
$query "INSERT INTO ".USERS_GB_TABLE."
              (user_id_gb, user_id_ein, user_name_gb, user_gb_text, user_gb_date, user_gb_read)
              VALUES
              ('"
.$_POST['user_id']."', '".$user_info[user_id]."', '".$user_info[user_name]."','".$text."', NOW(), ".$a.")";
    
$sql $site_db->query($query);

    
$msg .= "<meta http-equiv=refresh content=\"5; URL=member.php?action=showprofile&user_id=".$_POST['user_id']."\">\n
    <fieldset style=border : 1px solid blue><legend style=color: black;><b>"
.$lang['user_gb_new_ok']."</b>\n
    </legend>\n<table border=0 cellspacing=0 cellpadding=8><tr>\n
    <td><p>&nbsp;"
.$lang['user_gb_new_wait']."
    <a href=member.php?action=showprofile&user_id="
.$_POST['user_id'].">".$lang['user_gb_new_to']."</a><br></p></td></tr></table></fieldset>";
  }
  elseif (
$afg == "false")
  {
    
$id $_GET['user_id'];
  }

    if (
$config['bb_comments'] == 1) {
    
$site_template->register_vars(array(
      
"lang_bbcode" => $lang['bbcode'],
      
"lang_tag_prompt" => $lang['tag_prompt'],
      
"lang_link_text_prompt" => $lang['link_text_prompt'],
      
"lang_link_url_prompt" => $lang['link_url_prompt'],
      
"lang_link_email_prompt" => $lang['link_email_prompt'],
      
"lang_list_type_prompt" => $lang['list_type_prompt'],
      
"lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    
$bbcode $site_template->parse_template("bbcode"); }

    
$site_template->register_vars(array(
    
"user_gb" => $user_gb,
    
"bbcode" => $bbcode,
    
"head_gb" => $lang['user_gb_new'],
    
"button_send" => $lang['submit'],
    
"button_reset" => $lang['reset'],
    
"gb_id" => $user_id
    
));

    
$query "SELECT COUNT(*) FROM ".USERS_GB_TABLE." WHERE user_id_gb = ".$user_row['user_id']."";
#  $erg = $site_db->query_firstrow($query);
 
$resultmysql_query($query) or die("Fehler");
 
$erge mysql_fetch_row($result);
 
$erg $erge[0];

    
$user_gb_ein $erg;

    
$query "SELECT COUNT(*) FROM ".USERS_GB_TABLE." WHERE user_id_ein = ".$user_row['user_id']."";
#  $erg = $site_db->query_firstrow($query);
 
$resultmysql_query($query) or die("Fehler");
 
$erge mysql_fetch_row($result);
 
$erg $erge[0];

    
$user_gb_ge $erg;


    
$user_gb_link "<a href='member.php?action=showprofile&user_id=".$user_row['user_id']."'>".$lang['user_gb_too_gb'].$user_row['user_name']." (".$user_gb_ein.")</a>";

    
$site_template->register_vars(array(
    
"user_gb_ein" => $user_gb_ein,
    
"user_gb_ge" => $user_gb_ge,
    
"lang_gb_ein" => $lang['user_gb_ein'],
    
"lang_user_gb_er" => $lang['user_gb_er'],
    
"lang_user_gb_ge" => $lang['user_gb_ge'],
    
"user_gb_link" => $user_gb_link
    
));
///////////////////////////////////////////////



In closing, I want to thank Deskcom for creating this MOD which I think is way cool and one that will enhance our community website 20 feet.  There are always bugs and glitches in code, especially with new releases that jump from v.1.7.6 to v.1.7.7

Just because Deskcom didn't respond immediately doesn't mean he's a wave hog.  Everyone has a life and everyone gets busy.  I am just thankful that he took as much time as he did to create this MOD.  

All of us contribute and find solutions. I regret that I can't explain why this code fix works. All I did was take CyberAx's code and paste it in various places and do a lot of upload trial and error and eventually I found a code paste that resolved this glitch.

Keep ridin' those waves dude.

Brian
« Last Edit: March 30, 2010, 07:39:17 AM by Rembrandt »

Offline ghost_wizard

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #35 on: March 30, 2010, 02:40:26 PM »
Hey surferboy  :D
thanks for the code! I will try it today! i hope it works :roll:

greets
ghost

--edit--
Schade, geht auch nicht :(
Mit surferboys code komme ich gar nicht mehr auf die Seite! Der Installer zeigt mir auch immer einen Fehler!
Naja ich lass es dann mal! Der erste MOD der bei mir nicht funktioniert :cry:
« Last Edit: March 30, 2010, 04:11:34 PM by ghost_wizard »

Offline surferboy

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #36 on: April 09, 2010, 06:09:26 AM »
hi -

Just installed the Gravatar MOD - http://www.4homepages.de/forum/index.php?topic=24025.0, and realized that it would be so sweet to feature gravatars in the shoutbox. Anyone have any idea how to make that work?

Also, looks like the Received Comments V.2, topic 12695.0 MOD is causing some flyby's with the code on the Gravatar with [I suspect] the member.php file telling a new template file to show it's face, sans the usual template file called for in the Gravatar MOD. So any solutions may have to be a bit of a juggling act.

Thanks

Brian

Offline h24

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: [MOD] Per User Shouts/Guestbook V1.1
« Reply #37 on: March 11, 2011, 12:39:01 AM »
Bekomme immer eine Fehlermeldung( CSRF check failed.)
wo könnte das Problem sein