• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

AAC Znote problem in comments

Manigold

Active Member
Joined
Nov 2, 2017
Messages
197
Solutions
8
Reaction score
47
I'm using znote aac ,and i have a problem with character comments and guild motd .Hope someone can help-me.

Here's my problem, apparently the lines aren't breaking as they should :
znote comments1.png


znote comments2.png

myaccount.php comments part:
PHP:
            // Change character comment PAGE1:
            case 'change_comment':
                $render_page = false; // Regular "myaccount" page should not render
                if (user_character_account_id($char_name) === $session_user_id) {
                    $comment_data = user_znote_character_data(user_character_id($char_name), 'comment');
                    ?>
                    <!-- Changing comment MARKUP -->
                    <h1>Change comment on:</h1>
                    <form action="" method="post">
                        <ul>
                            <li>
                                <input name="action" type="hidden" value="update_comment">
                                <input name ="selected_character" type="text" value="<?php echo $char_name; ?>" readonly="readonly">
                            </li>
                            <li>
                                <font class="profile_font" name="profile_font_comment">Comment:</font> <br>
                                <textarea name="comment" cols="70" rows="10"><?php echo preg_replace('/\v+|\\\r\\\n/','<br/>',   $comment_data['comment']); ?></textarea>
                            </li>
                            <?php
                                /* Form file */
                                Token::create();
                            ?>
                            <li><input type="submit" value="Update Comment"></li>
                        </ul>
                    </form>
                    <?php
                }
                break;
            //end
        }
    }
}

and characterprofile.php comments part:
PHP:
                <!-- Display player status end -->
                <?php if (isset($profile_znote_data['comment']) === true && empty($profile_znote_data['comment']) === false) { ?>
            <tr><td>Comment:</td>
            <td><?php echo preg_replace('/\v+|\\\r\\\n/','<br />',   $profile_znote_data['comment']); ?></td></tr>
                <?php } ?>
 
Bumb , is not possible to make the lines break automatically let's say before a certain number of cols?
Post automatically merged:

ok i managed to fix the characters comment page with this :
PHP:
            <tr><td>Comment:</td>
            <td><?php echo wordwrap($profile_znote_data['comment'], 90, "<br />\n", true);?></td>
                <?php } ?>
But now i'm strugling with the guild motd part:
PHP:
        foreach ($guilds as $guild) {
            if ($guild['total'] >= 1) {
                    $url = url("guilds.php?name=". $guild['name']);
                echo '<tr>';
                echo '<td><center><img style="max-width: 64px; max-height: 64px;" src="';
                echo logo_exists($guild['name']);
                echo '"/></center></td>';
                echo '<td><center> <a href="' . $url . '">'. $guild['name'] .'</a><br>'. $guild['motd'] .'</center></td>';
                echo '<td><center>'. $guild['total'] .'</center></td>';
                echo '<td><center>'. getClock($guild['creationdata'], true) .'</center></td>';
                echo '</tr>';
            }
        }
I hope someone can help me with this =)
 
Last edited:
Ok i don't know if i did it the best way cause i don't understand nothing about php ,but i fixed the guild motd this way:
after this part :
PHP:
// Display the guild list

//data_dump($guild, false, "guild data");

$guilds = guild_list($config['TFSVersion']);

if (isset($guilds) && !empty($guilds) && $guilds !== false) {
    //data_dump($guilds, false, "Guilds");
?>
I added this:
PHP:
        <style type="text/css">
            table {border-collapse:collapse; table-layout:fixed; width:910px;}
            table td {width:100px; word-wrap:break-word;}
        </style>

and changed this:
PHP:
                <p><?php echo $guild['motd']; ?></p>
for this:
PHP:
                <p><?php echo wordwrap($guild['motd'], 100, "<br />\n", true);?></p>

I hope this helps someone else who has the same problem =)
 
Back
Top