[2.0.15] Longer Subjects

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
5
63%
Very Good
2
25%
Good
1
13%
Fair
0
No votes
Poor
0
No votes
 
Total votes : 8

[2.0.15] Longer Subjects

Postby MOD Robot » Tue Jun 14, 2005 9:54 pm

MOD Name: Longer Subjects
Author: drathbun
MOD Description: This MOD allows you to increase the size of the subject for topics and posts.


MOD Version: 1.0.0

Download File: longer_subjects.zip
mods overview page: View
File Size: 1335 Bytes

Security Score: 0
Last edited by MOD Robot on Mon Apr 30, 2007 12:27 am, edited 1 time in total.
(this is a non-active account manager for the phpBB MOD Team)
MOD Robot
MOD Queue Bot
MOD Queue Bot
 
Posts: 22154
Joined: Sat Aug 16, 2003 7:36 am

Postby TerraFrost » Wed Jun 15, 2005 7:10 pm

MOD Validated/Released

Notes:
Extends the maximum length of the subject to 100 characters.
User avatar
TerraFrost
Development Team Member
Development Team Member
 
Posts: 5940
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Postby drathbun » Thu Jun 16, 2005 1:51 am

TerraFrost wrote:MOD Validated/Released

Notes:
Extends the maximum length of the subject to 100 characters.

The number "100" may be changed to any desired value from 1 :shock: up to 255. The topic_title field in phpbb_topics and the post_subect in phpbb_posts_text are both defined as type "varchar" which for MySQL is limited to 255 total characters. By "changed" I mean simply substitute your own value for the "100" shown in the MOD instructions. Note that if you shorten the field at a later date you will lose information.

I do not yet offer an "installer" for this MOD, but plan to soon. Until then you will (unfortunately) have to run the SQL queries via phpMyAdmin, via the MySQL command interface, or other method.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
 
Posts: 12160
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE

Postby NightriderXP » Thu Jun 23, 2005 7:52 am

This worked just as advertised on my board. I had no trouble installing it using EasyMOD. Thanks drathbun...

:lol:
NightriderXP
Registered User
 
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US

Postby rreptile » Fri Jul 22, 2005 9:14 pm

I am having difficulty understanding how to deal with the SQL part. I'm hoping that I can do it manually rather than using a program like phpMyAdmin. Where and/or how exactly do I do this?

If it is not possible to do it manually, am I to save longer_subjects.txt as longer_subjects.php?? After doing so, where do I put the file?

Please excuse the inane idiocy of my questions. I know very little about php and am ashamed to admit the need for spoonfeeding.

Please rest assured that I have read through
http://www.phpbb.com/kb/article.php?article_id=150
and have no difficulty at all with understanding the "find and replace" concept.

After reading the following,
Code: Select all
## installer that will recognize the proper table prefix. If
## you can test this MOD on databases other than MySQL and
## provide the correct syntax I would appreciate it.If
## you can test this MOD on databases other than MySQL and
## provide the correct syntax I would appreciate it.


I was hoping someone would point out what other database names I should be looking for in my account in order to run the SQL section of the mod.
rreptile
Registered User
 
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Postby NightriderXP » Sat Jul 23, 2005 3:28 am

Hey rreptile, I hope this helps you. I wrote these instructions to help people witht heir SQL code in the Topic Calendar. But they are just as helpful here as well. The only thing different would be the SQL code that you will apply to your database...

The following is how you apply your code manually to your phpMyAdmin database. You can get into your database through your CPanel by clicking on phpMyAdmin. Follow the following instructions:

I'm sure that every host is different. I will tell you how I run my queries manually and hopefully it will be close to what you have available to you. The following may or may not be similar to what you have...

Log into your domain Control Panel and find the database icons. You should be able to find the phpMyAdmin icon. Click on it...

Image

Hopefully that will log you into your phpAdmin panel. You may need to provide a username and password...

In the phpMyAdmin panel, click on the Databases hyperlink...

Image

Hopefully that should take you where you can select your database. You may only have one. Select your database hyperlink...

Image

That should open up the display of all the tables in your database. Ignore them. Somewhere on the page, you should see something similar to this:

Image

Click on the SQL tab to display something like the following where you can copy all of the SQL commands in at once:

Image

Click on the Go button and the queries will be run. If all goes well, you will be told that the commands were executed successfully. Otherwise you will see a screen that tells you which command failed. If the columns that you are trying to add already exist, a duplicate will not be added...

Hopefully my instructions above are close to what you would see on your domain. If not, perhaps you could provide some screenshots of what you have available and we can figure out what you need to do. I use Gadwin Printscreen to create the screenshots and www.ImageShack.us to host them so they can be posted here...

I hope this all made sense to you rreptile...

:lol:
NightriderXP
Registered User
 
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US

Postby rreptile » Sat Jul 23, 2005 11:43 pm

Thank you for your detailed reply, NightriderXP.

Alas, every host IS different. I'm going to have to contact them to find out where on earth the mySQL section is in the control panel. (I know that there is such a section because my forum is up and running.)

Once I find the elusive mySQL section, I'm sure I'll be able to apply your directions. If not, I'll come whimpering back.
rreptile
Registered User
 
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Postby NightriderXP » Sun Jul 24, 2005 12:42 am

Good luck rreptile. Every host I have dealt with have been very helpful, so hopefully your call will be equally productive...

:lol:
NightriderXP
Registered User
 
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US

Postby drathbun » Mon Jul 25, 2005 1:29 am

Over at the "phpbbhacks" site they have a tool that allows you to convert sql scripts into a php program that you can upload, run, and then delete. Here's the code that was generated for the two sql commands required for this MOD:
Code: Select all
<?php
/***************************************************************************
*                               db_update.php
*                            -------------------
*
*   copyright            : ©2003 Freakin' Booty ;-P & Antony Bailey
*   project              : http://sourceforge.net/projects/dbgenerator
*   Website              : http://freakingbooty.no-ip.com/ & http://www.rapiddr3am.net
*
***************************************************************************/

/***************************************************************************
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   (at your option) any later version.
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//


if( !$userdata['session_logged_in'] )
{
   $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
   header($header_location . append_sid("login.$phpEx?redirect=db_update.$phpEx", true));
   exit;
}

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}


$page_title = 'Updating the database';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "alter table " . $table_prefix . "posts_text
modify post_subject varchar(100)";
$sql[] = "alter table " . $table_prefix . "topics
modify topic_title varchar(100)";

for( $i = 0; $i < count($sql); $i++ )
{
   if( !$result = $db->sql_query ($sql[$i]) )
   {
      $error = $db->sql_error();

      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
   }
   else
   {
      echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successful</b></font></li><br />';
   }
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28">&nbsp;</td></tr>';

echo '<tr><th>Installation Complete</th></tr><tr><td><span class="genmed">Please be sure to delete this file now.<br />If you require any further assistance, please visit the <a href="http://www.phpbbhacks.com/forums">phpBBHacks.com Support Forums</a>.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Go back to your index page</a>.</span></td></table>';

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>

Note that I have only briefly reviewed this code, and it appears that it will work, but I have not tested it and make no guarantees that it will work. The link to the db generator script is http://www.phpbbhacks.com/forums/db_generator.php
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
 
Posts: 12160
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE

Postby rreptile » Mon Jul 25, 2005 3:10 pm

Thank you, drathbun. I would like to try this.

Do I place the db_update.php (that will be deleted once it has run) in the root folder of my phpbb?
rreptile
Registered User
 
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Postby drathbun » Mon Jul 25, 2005 3:21 pm

rreptile wrote:Thank you, drathbun. I would like to try this.

Do I place the db_update.php (that will be deleted once it has run) in the root folder of my phpbb?

Yes, I think so. You will run it once, and then immediately delete the file. As I mentioned, I have not tested the code, and it was generated by a tool from phpbbhacks. However, it looks okay.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
 
Posts: 12160
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE

Postby rreptile » Mon Jul 25, 2005 5:05 pm

drathbun wrote:You will run it once, and then immediately delete the file.


Bingo!!

Thank you very much for all the help.
rreptile
Registered User
 
Posts: 166
Joined: Wed Oct 06, 2004 12:51 pm
Location: Canada

Postby shadav » Wed Mar 08, 2006 3:05 pm

drathbun wrote:The number "100" may be changed to any desired value from 1 :shock: up to 255. The topic_title field in phpbb_topics and the post_subect in phpbb_posts_text are both defined as type "varchar" which for MySQL is limited to 255 total characters.


Very nice mod :) 8O 255 lol that's a bit much...i think 100 is long enough for a subject lol

Just to give everyone an idea of the size, this sentence is 97 characters long, including spaces!
User avatar
shadav
Registered User
 
Posts: 139
Joined: Thu Dec 01, 2005 7:12 pm
Location: Drowning In Corn Fields

Thanks for the MOD

Postby robertjacobs » Thu Jun 15, 2006 7:58 am

Thanks for the MOD. Installed it on a dummy site running 2.0.21 and it's working fine. Nice simple MOD, installed without problems.

Cheers a bunch,
Rob
User avatar
robertjacobs
Registered User
 
Posts: 12
Joined: Thu Jun 15, 2006 7:24 am

Re: Thanks for the MOD

Postby drathbun » Fri Jun 16, 2006 12:38 am

robertjacobs wrote:Nice simple MOD

That's the best kind, in my opinion. :-D Thanks for the feedback, good luck with your project. 8)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
 
Posts: 12160
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE

Next

Return to [2.0.x] MOD Database Cleanup

Who is online

Users browsing this forum: No registered users and 1 guest