Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
calendar_open_closeCalendar 
Need help with EM install
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
Need help with EM install
PostPosted: 05/23/2007 10:14 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 12:12 AM
Location: Denver, PA
usaCa.gif
Hello Nightrider!

I have a find and replace with that I need help with in my easy subforums install on DM.

Original install file

The find and replace I am stuck on.

Code:
#
#-----[ FIND ]------------------------------------------------
#
            $sql = "UPDATE " . FORUMS_TABLE . "
            SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
            WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);

#
#-----[ REPLACE WITH ]----------------------------------------
#
   // Modified by Easy Sub-Forums MOD
         if (isset($HTTP_POST_VARS['detach_enabled']) && isset($HTTP_POST_VARS['has_subforums']))
         {
            $sql = "UPDATE ". FORUMS_TABLE. " SET attached_forum_id=-1 WHERE attached_forum_id=" . intval($HTTP_POST_VARS[POST_FORUM_URL]);
            if( !$result = $db->sql_query($sql) )
            {
               message_die(GENERAL_ERROR, "Couldn't detach subforums", "", __LINE__, __FILE__, $sql);
            }

         }

          if (intval($HTTP_POST_VARS['old_cat_id']) != intval($HTTP_POST_VARS[POST_CAT_URL]))
            {
            $HTTP_POST_VARS['attached_forum_id']=-1;
            if (isset($HTTP_POST_VARS['has_subforums']) && !isset($HTTP_POST_VARS['detach_enabled']))
            {
               $sql = "UPDATE ". FORUMS_TABLE ." SET cat_id=". intval($HTTP_POST_VARS[POST_CAT_URL]) ." WHERE attached_forum_id=" . intval($HTTP_POST_VARS[POST_FORUM_URL]);
               if( !$result = $db->sql_query($sql) )
               {
                  message_die(GENERAL_ERROR, "Couldn't update subforums to new category", "", __LINE__, __FILE__, $sql);
               }

            }
         }

         $sql = "UPDATE " . FORUMS_TABLE . "
            SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) .", attached_forum_id = " . intval($HTTP_POST_VARS['attached_forum_id']) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
            WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
   // End Added by Easy Sub-Forums MOD


The find in my file

Code:
$sql = "UPDATE " . FORUMS_TABLE . "
            SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
, forum_postcount = " . intval($HTTP_POST_VARS['forum_postcount']) . "
            WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Need help with EM install
PostPosted: 05/23/2007 10:26 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 12:12 AM
Location: Denver, PA
usaCa.gif
wait, I think I got it, sorry for jumping the gun there. It confused me the first time I saw it but I think I got it taken care of now. I might be right back with more though because this one seems to want to have trouble in every file!
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Need help with EM install
PostPosted: 05/23/2007 11:11 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 12:12 AM
Location: Denver, PA
usaCa.gif
Well I had to do 4 edits with a find and replace in .php files, and it obviously didn't work too well for me.  hysterical2  But hey, I tried!

I got the mod to install smoothly with easyMOD, and do not have any errors yet that I can see, however the last post area of the index.php is messed up and the edits in the admin_forums.php didn't work either since I can't create a subforum.

I am going to go ahead and back it back out. I think my first edit was good, but this one I posted in this thread first might be the first edit where I went wrong. Can you go over it and let me know what the correct find and replace would be for this find.

It's probably easier for me to start over and get your help than for you to go troubleshoot my meshing of mods.  Embarassed
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Need help with EM install
PostPosted: 05/24/2007 2:24 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 12:12 AM
Location: St Pete, FL
peace.gif
The first major problem I see with this MOD is that the files listed in most of the OPEN commands start with a /.  Even though EM doesn't flag this as an error, EM will not overwrite those files with the edited versions.  Since some of the OPEN commands are correct, that would explain why the MOD didn't install correctly.  Some of the files were successfully modified while others weren't...

For example.  This:

Code:
#
#-----[ OPEN ]------------------------------------------------
#
   /includes/functions.php

Should look like this instead:

Code:
#
#-----[ OPEN ]------------------------------------------------
#
includes/functions.php

Many of the other OPENs need to be corrected as well...

Shocked
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Need help with EM install
PostPosted: 05/24/2007 2:47 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 12:12 AM
Location: Denver, PA
usaCa.gif
Shocked  Yikes. Thank you, I will go through and fix all of those and try again and see how it goes.
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Need help with EM install
PostPosted: 05/24/2007 3:30 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 12:12 AM
Location: Denver, PA
usaCa.gif
Awesome! It is installed and working correctly except for my index.php edit.



The original mod:

Code:
#
#-----[ FIND ]------------------------------------------------
#


                        $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = $last_post_time . '<br />';

                        $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
                        
                        $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';

#
#-----[ REPLACE WITH ]----------------------------------------
#
   // Modified by Easy Sub-Forums MOD

                        if (strlen($forum_data[$j]['topic_title'])>=25)
                        {
                           $forum_data[$j]['topic_title']=substr($forum_data[$j]['topic_title'], 0,25). "...";
                        }

                        $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = '' . $last_post_time . '' . '<br />';
                        
                        $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> <a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
   // END Modified by Easy Sub-Forums MOD


My original find I had to work with

Code:
$last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = $last_post_time . '<br />';

                        $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']);
                        
                        $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';


My edit that is not working. It was just a guess.

Code:
#
#-----[ REPLACE WITH ]----------------------------------------
#
   // Modified by Easy Sub-Forums MOD

                        if (strlen($forum_data[$j]['topic_title'])>=25)
                        {
                           $forum_data[$j]['topic_title']=substr($forum_data[$j]['topic_title'], 0,25). "...";
                        }

                        $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = '' . $last_post_time . '' . '<br />';
                        
                        $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> <a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
   // END Modified by Easy Sub-Forums MOD
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Need help with EM install
PostPosted: 05/24/2007 11:22 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 12:12 AM
Location: St Pete, FL
peace.gif
Yes, your guess was close.  You added the color_group_colorize_name option correctly, but failed to remove the end of the hyperlink that it was replacing.  This is the how you would fix the MOD script to install correctly:

OPEN
Easy Sub-Forums v1.0.8/install_edited.txt

FIND
Code:
color_group_colorize_name($forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a>

IN-LINE FIND
Code:
color_group_colorize_name($forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a>

IN-LINE REPLACE WITH
Code:
color_group_colorize_name($forum_data[$j]['user_id']) . '

Save, upload, and try again using EM...

When done, the line would look like this:

Code:
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : color_group_colorize_name($forum_data[$j]['user_id']) . ' <a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';


headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Need help with EM install
PostPosted: 05/25/2007 7:58 AM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 12:12 AM
Location: Denver, PA
usaCa.gif
Thank you very much Blake!  banana
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Need help with EM install
PostPosted: 05/25/2007 3:27 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 12:12 AM
Location: St Pete, FL
peace.gif
As always, you are quite welcome Sarah...

banana  banana  banana  banana  banana
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group

Page generation time: 0.171s (PHP: 44% - SQL: 56%) - SQL queries: 54 - GZIP disabled - Debug on