[Bugfix] Change Poster Mod 1.0

Kleine Codeänderungen oder Mini-MODs
Keine Anfragen!!! -- No requests!!!

Moderator: Supporter

[Bugfix] Change Poster Mod 1.0

Beitragvon AmigaLink » 1. Mai 2005 21:10

Dieser Fix bezieht sich auf die Version 1.0 in der (laut Installationsanleitung) bereits ein Fix von oxpus enthalten ist.

Er behebt 2 Fehler im Mod:
  1. Beim versuch den Autor des ersten Postings eines Topics (und somit den Topicautor) zu ändern, kommt es zu einer (SQL-)Fehlermeldung wodurch die Änderung nicht durchgeführt wird.
  2. Die Beitragszähler der betroffenen User werden nicht angepasst.

Code: Alles auswählen
#
#----------[ OPEN ]-------------------------------------
#

changeuser.php

#
#----------[ FIND ]-------------------------------------
#

      //----------------------
      // * change poster
      //----------------------
      $sql = "SELECT user_id FROM " . USERS_TABLE . " WHERE username = '" . $newposter . "'";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, $lang['ChgP_NoUser'], '', __LINE__, __FILE__, $sql);
      }
      $row = $db->sql_fetchrow($result);
      $newposter_id = $row['user_id'];
      $db->sql_freeresult($result);

      $sql = "UPDATE " . POSTS_TABLE . " SET poster_id=" . $newposter_id . " WHERE post_id =" . $changeid;
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, $lang['ChgP_WrongID'], '', __LINE__, __FILE__, $sql);
      }

      //----------------------
      // * change post counter
      //----------------------
      $sql = "SELECT poster_id FROM " . POSTS_TABLE . " WHERE post_id =" . $changeid;
      if( ($result = $db->sql_query($sql)) )
      {
         $row = $db->sql_fetchrow($result);
         $oldposter = $row['poster_id'];
         $db->sql_freeresult($result);
         $sql = "UPDATE " . USERS_TABLE . " SET user_posts=user_posts-1 WHERE user_id =" . $oldposter;
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, $lang['ChgP_Error'], '', __LINE__, __FILE__, $sql);
         }
      }

      $sql = "UPDATE " . USERS_TABLE . " SET user_posts=user_posts+1 WHERE user_id = " . $newposter_id;
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, $lang['ChgP_Error'], '', __LINE__, __FILE__, $sql);
      }

#
#----------[ REPLACE WITH ]-----------------------------
#

      $sql = "SELECT user_id FROM " . USERS_TABLE . " WHERE username = '" . $newposter . "'";
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, $lang['ChgP_NoUser'], '', __LINE__, __FILE__, $sql);
      }
      $row = $db->sql_fetchrow($result);
      $newposter_id = $row['user_id'];
      $db->sql_freeresult($result);

      //----------------------
      // * change post counter
      //----------------------
      $sql = "SELECT poster_id FROM " . POSTS_TABLE . " WHERE post_id =" . $changeid;
      if( ($result = $db->sql_query($sql)) )
      {
         $row = $db->sql_fetchrow($result);
         $oldposter = $row['poster_id'];
         $db->sql_freeresult($result);
         $sql = "UPDATE " . USERS_TABLE . " SET user_posts=user_posts-1 WHERE user_id =" . $oldposter;
         if ( !($result = $db->sql_query($sql)) )
         {
            message_die(GENERAL_ERROR, $lang['ChgP_Error'], '', __LINE__, __FILE__, $sql);
         }
      }

      $sql = "UPDATE " . USERS_TABLE . " SET user_posts=user_posts+1 WHERE user_id = " . $newposter_id;
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, $lang['ChgP_Error'], '', __LINE__, __FILE__, $sql);
      }

      //----------------------
      // * change poster
      //----------------------
      $sql = "UPDATE " . POSTS_TABLE . " SET poster_id=" . $newposter_id . " WHERE post_id =" . $changeid;
      if ( !($result = $db->sql_query($sql)) )
      {
         message_die(GENERAL_ERROR, $lang['ChgP_WrongID'], '', __LINE__, __FILE__, $sql);
      }

#
#----------[ FIND ]-------------------------------------
#

         $sql = "UPDATE " . TOPICS_TABLE . " SET topic_poster=" . $newposter . " WHERE topic_id =" . $changetid;

#
#----------[ REPLACE WITH ]-----------------------------
#

         $sql = "UPDATE " . TOPICS_TABLE . " SET topic_poster=" . $newposter_id . " WHERE topic_id =" . $changetid;

#
#----------[ SAVE AND CLOSE ALL FILES ]-----------------
#
# EoM
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon mariocaz » 18. Jun 2005 07:03

Hello my friend!!! :P

I don't understand this bug and the fix jejeje because I don't speak German :roll:

This bug is already fix in the download file ??? :shock:

Where can I have this MOD ?? :?

I know I haven't 25 posts yet :( , but can you send me to my mail ?

Please say YES! 8)
mariocaz
User
 
Beiträge: 148
Registriert: 9. Jun 2005 07:35

Beitragvon AmigaLink » 18. Jun 2005 12:08

It fixes two bugs.
1. with this fix you can change the topicautor!
2. the postcounter of the concerned users will now be changed too! :P

I don't no the original of this mod. I have the file from www.oxpus.de and i have seen that there is alrteady a fix includet.
But this fix, that i have posted here, is not in the MOD package!

I know I haven't 25 posts yet :(, but can you send me to my mail ?

Excuse, but I cannot send every MOD to you. Otherwise I make nothing other more shortly. :roll:
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon mariocaz » 21. Jun 2005 02:01

Mmmmm I see that I have to have 25 posts for download this MODS! :cry:

Added after 18 seconds:

Added after 57 hours 24 minutes:

Hello my friend!!! 8)

I just have installed this MOD (thanx very much :P ) with assistance of a translator in the net jejejeje (a little easy) :lol:

Works very fine! :)

But I have a little problem :roll: ... I don't see the image(icon) of the MOD in the posts of both templates than I have. :(

I reviewed and reviewed the install instructions and I did all well. :?

Also check that I put the image(icon) of the MOD in the correct place.

/templates/FiSubilversh and Fiblue3d/images/languages (spanish and english)/icon_user.gif

And also I did the Bugfix of the top of this post. :wink:

And I don't know what is happen?, I am trying to find the bug but I can't please help me!! :oops:

I attach here my viewtopic.php file (I think here is the problem).

Thanx again Amigalink!!! :o

[center][ Attachment gelöscht am 21.06.2005, 20:41 von AmigaLink ][/center]
mariocaz
User
 
Beiträge: 148
Registriert: 9. Jun 2005 07:35

Beitragvon AmigaLink » 21. Jun 2005 13:18

Place this line in you template.cfg files:
Code: Alles auswählen
$images['icon_user'] = "$current_template_images/{LANG}/icon_user.gif";
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon mariocaz » 21. Jun 2005 18:19

Hello!!

Where is that file or files template.cfg ?? ...I´m searched but I didn´t find it. :?

And in which part of the file I have to place that line ? :)
mariocaz
User
 
Beiträge: 148
Registriert: 9. Jun 2005 07:35

Beitragvon AmigaLink » 21. Jun 2005 18:30

FiSubilversh.cfg and Fiblue3d.cfg :D
Place the line before ?>
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon mariocaz » 21. Jun 2005 19:00

Jejeje :lol: Thank you and so sorry! :oops:

I also did that, but the image continues without appears. :?

I click with the mouse(right button) in the X image of the icon and in the propperties said this:

http://www.all-reefs.com/inicio/templat ... gif%20alt=

and

http://www.all-reefs.com/inicio/templat ... gif%20alt=

This part %20alt= is added for error, but where is it ?? (in which file?)

The corrects directions are:

http://www.all-reefs.com/inicio/templat ... n_user.gif
http://www.all-reefs.com/inicio/templat ... n_user.gif

and

http://www.all-reefs.com/inicio/templat ... n_user.gif

Where can I fix this? :o

Thanx again my friend.



I fixed it my friend!!! yupi yupi!!! :D :o :) :wink:

In the instructions of the MOD was a wrong part.

Here.

Code: Alles auswählen
// Change Poster Mod
   $temp_url = append_sid("changeuser.$phpEx?" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
   $reassign_img = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_user'] . ' alt="' . $lang['Change_poster'] . '"</a>' : '';
   $reassign = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '">' . $lang['Change_poster'] . '</a>' : '';




And the correct is:

Code: Alles auswählen
// Change Poster Mod
   $temp_url = append_sid("changeuser.$phpEx?" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
   $reassign_img = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_user'] . '" alt="' . $lang['Change_poster'] . '"</a>' : '';
   $reassign = ( $userdata['user_level'] == ADMIN ) ? '<a href="' . $temp_url . '">' . $lang['Change_poster'] . '</a>' : '';



The fix is in this part are missing the ..."

$images['icon_user'] . '"

Well thank you again, I´m very happy!!! :P
mariocaz
User
 
Beiträge: 148
Registriert: 9. Jun 2005 07:35

Beitragvon AmigaLink » 21. Jun 2005 19:40

Fine, so is here one more fix. :P
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Beitragvon dagobert » 24. Jul 2005 02:13

huhu amiga.....


there is another issue with this mod. perhaps someone got an idea ?

the problem is, if you change the first post....the topicauthor....the changes are not shown on forum index ! there i can still find the original poster.

seems if a sql command is missing, what changes the entries in the topic table......in the post table everything is correct.


greetz and a good night !
dagobert
 
Beiträge: 11
Registriert: 2. Sep 2004 15:57

Nächste

Zurück zu phpBB2 Snippets



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 12 Gäste

cron