increase max topic title lenght

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
RedNaxi
Registered User
Posts: 3
Joined: Thu Aug 21, 2008 10:19 am

increase max topic title lenght

Post by RedNaxi »

Hi!
sorry for my bad english=\
I need to inrease max topic title lenght - 60 chars is too litle for my forum, i need minimum 120... somewhere i read what in 3.0.2 max lenght will be 150, but after update i didn't see any changes...
in this forum i found topic about phpbb 2, but mod for phpbb 2 didn't work on phpbb3...
in russian support forum i found this mod:

Code: Select all

    #
    #------- [SQL] -----------
    #
    ALTER TABLE `phpbb_posts` CHANGE `post_subject` `post_subject` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
    ALTER TABLE `phpbb_topics` CHANGE `topic_title` `topic_title` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;

    #
    #------- [OPEN] -----------
    #
    includes\functions_posting.php

    #
    #------- [FIND] -----------
    #
       $subject = truncate_string($subject);
       $data['topic_title'] = truncate_string($data['topic_title']);

    #
    #------- [REPLACE WITH] -----------
    #
       $subject = truncate_string($subject, 120);
       $data['topic_title'] = truncate_string($data['topic_title'], 120);

    #
    #------- [OPEN] -----------
    #
    styles\prosilver\template\mcp_topic.html

    #
    #------- [FIND] -----------
    #
    <dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SPLIT_SUBJECT}" title="Type the post subject" class="inputbox" /></dd>

    #
    #------- [REPLACE WITH] -----------
    #
    <dd><input type="text" name="subject" id="subject" size="60" maxlength="128" tabindex="2" value="{SPLIT_SUBJECT}" title="Type the post subject" class="inputbox" /></dd>

    #
    #------- [OPEN] -----------
    #
    styles\subsilver2\template\posting_body.html

    #
    #------- [FIND] -----------
    #
          <input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" />

    #
    #------- [REPLACE WITH] -----------
    #
          <input class="post" style="width:450px" type="text" name="subject" size="60" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->128<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" />

    #
    #------- [OPEN] -----------
    #
    styles\subsilver2\template\mcp_topic.html

    #
    #------- [FIND] -----------
    #
    <input class="post" style="width: 350px" type="text" size="35" maxlength="64" name="subject" value="{SPLIT_SUBJECT}" />

    #
    #------- [REPLACE WITH] -----------
    #
    <input class="post" style="width: 350px" type="text" size="45" maxlength="128" name="subject" value="{SPLIT_SUBJECT}" />
    #
    #------- [OPEN] -----------
    #
    styles\prosilver\template\posting_editor.html

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

          <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>

    #
    #------- [REPLACE WITH] -----------
    #
          <dd><input type="text" name="subject" id="subject" size="60" maxlength="<!-- IF S_NEW_MESSAGE -->124<!-- ELSE -->128<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
but with this mod users have troubles:

Code: Select all

    Общая ошибка
    SQL ERROR [ mysql4 ]

    Data too long for column 'forum_last_post_subject' at row 1 [1406]

    SQL

    UPDATE phpbb3_forums SET forum_topics_real = forum_topics_real - 1, forum_posts = forum_posts - 1, forum_topics = forum_topics - 1, forum_last_post_id = 7700, forum_last_post_subject = '/"FARMLINK": ОБМАНЫ ПО ЗАРПЛАТЕ И РАСХОДАМ + КРИМИНАЛЬНЫЕ ДЕЙСТВИЯ В ОТНОШЕНИИ СОТРУДНИКОВ !!!', forum_last_post_time = 1214681093, forum_last_poster_id = 2, forum_last_poster_colour = '', forum_last_poster_name = 'Молодогвардеец-Котище' WHERE forum_id = 6

    BACKTRACE

    FILE: includes/db/mysql.php
    LINE: 158
    CALL: dbal->sql_error()

    FILE: includes/functions_posting.php
    LINE: 1512
    CALL: dbal_mysql->sql_query()

    FILE: posting.php
    LINE: 1443
    CALL: delete_post()

    FILE: posting.php
    LINE: 280
    CALL: handle_post_delete()
User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Re: increase max topic title lenght

Post by pentapenguin »

Run this SQL update too:

Code: Select all

ALTER TABLE phpbb3_forums CHANGE `forum_last_post_subject` `forum_last_post_subject` VARCHAR( 200 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.
dem_
Registered User
Posts: 17
Joined: Tue Apr 08, 2008 9:11 pm

Re: increase max topic title lenght

Post by dem_ »

in version 3.0.2 the default value is a VARCHAR( 255 ) for that field, there is a function on post_body.html (the template) that limits to 60 or 64 depending on the situation post or reply, I removed this limit by replacing the 60 and 64 form 120 in both cases... when posting i can "post" the 120 characters but when reading the final post it still appears truncated is there another limit i overlooked? im guessing is on the sql insert query

Code: Select all

<td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->120<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
thats the line that used to truncate the string now it suposed to truncate it a 120 i checked the db and is 60...

Return to “[3.0.x] Support Forum”