Jump to content

Open Coterie  ·  19 members

SMF Staff People

Character Mod


Jones
 Share

Recommended Posts

Dear @Arceus,

 

You're not sick of me yet are you?

 

First of yay! I have been really eager to get the mod up and running on my WiP site. Sadly I am not code, smf, or php savvy enough to know how to fix the issues I ran into. On initial install it gave me a few failed tests. I noted those in case it would be helpful but they were all easy to just fix by hand so I did that no problem.

 /Sources/Load.php

/Sources/Post.php

/Sources/Recent.php

There were 2 errors in my custom theme, but when I glanced over them they looked like they were only relevant to the board stats and the post display. So I edited them to fit into my theme (and the board stats one at least works fine).

 

Buuuuut, I guess because I'm using a custom theme the front-end dropdown menu bit for the character mod is no where to be found. I didn't expect it to appear on my theme from jump but I figured it would show up on the default curve theme and I'd just copy paste what I need. Except I could not find it in boardindex template or index template. I tried to switch over to default theme thinking I could track it down that way but the block of code that goes in the stats section of the default boardindex template is causing an error. First it said unexpected '.' so I hunted down which period was causing that but then it wanted me to feed it a comma and I have not been able to figure out where it goes. I took that code block out so I could access the home page but of course the dropdown for the character mod was not there. lol. 

 

At this point, I am wondering how much the install fee you mention on the file page is. Because I have no clue what needs to go where to make it work. All the bits on the admin panel end are there. It's just the front-end stuff I am missing.

 

I am also having a really weird theme issue that I could use another set of eyes on. I've never done a theme from scratch for SMF but I started out with your curvewithoutstupid file and I've been working my way through. I've bent index template, boardindex template, messageindex template to my will and I've started on display template. Everything looked the way I wanted it too... I thought, but inside of just one board the topics are broken and crazy looking. The board link is http://www.operationbowtruckle.com/index.php and the board that won't behave is Site Information. Thank you in advance for any help you can offer. 

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

That's a lotta stuff. Lol

 

That is one helluva glitch you got goin' on there... I believe, this is best guess, there is a login form that is being repeatedly submitted by something. It basically goes straight to action=login2 every second. I can't get it to hold still long enough for me to look at it and try finding what's doing it and why, so you're unfortunately kind of on your own with that one, and until it stops, I can't really help with the theme glitch.

 

I'll have to fix that in the installer, I apparently got fat-fingers, but this is what the boardindex.template stats bit should look like.

	// Show statistical style information...
	if ($settings['show_stats_index'])
	{
		echo '
			<div class="title_barIC">
				<h4 class="titlebg">
					<span class="ie6_header floatleft">
						<a href="', $scripturl, '?action=stats"><img class="icon" src="', $settings['images_url'], '/icons/info.gif" alt="', $txt['forum_stats'], '" /></a>
						', $txt['forum_stats'], '
					</span>
				</h4>
			</div>
			<p>
				', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], ' ',$txt['and'],' ',$context['common_stats']['total_characters'],' ',($context['common_stats']['total_characters'] == 1 ? $txt['acm_character'] : $txt['acm_characters']),' ( ',$context['common_stats']['total_npcs'],' ',($context['common_stats']['total_npcs'] == 1 ? $txt['acm_npc'] : $txt['acm_npcs']),' ). ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', ' ',!empty($context['common_stats']['latest_character']['id']) ? ' - '.$txt['acm_latest_character'].' <strong>'.$context['common_stats']['latest_character']['link'].'</strong>' : '','<br />
				', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>&quot;' . $context['latest_post']['link'] . '&quot;</strong>  ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
				<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br />
				<a href="' . $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
			</p>';
	}

You'll also need to find this in messageindex.template:

<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', (!empty($board['last_post']['character']['id']) ? $board['last_post']['character']['link'] : $board['last_post']['member']['link'])), '<br />

And remove that extra ) at the end to unbreak your topics view. May need to do the same thing for $topic['last_post'] I believe it was copied straight from the $board['last_post'] bit so it probably also has an extra ).

 

If you are not using template_menu() for your main navigation, you'll have to put the menu link up there for it manually, whatever way it's coded. Basically the main menu context is set up in Subs.php using arrays and template_menu() arranges those arrays into its HTML, so if you're doing it a totally different way, the root template_menu() context array in Subs.php won't help you anyway.

There are two possibilities for it not showing up on default Curve:

  1. It actually did fail to install on Subs.php properly, easiest thing to do with that is just upload your Subs.php here for me.
  2. Do you use a menu editor? Bc it overrides Subs.php and pulls from database, which means you'll have to add new buttons for mods to it yourself in the menu editor acp section.

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

Holy bologna no kidding 😣 I didn't even realize it was doing that! Not sure what went wrong, it was fine the last time I checked it. I've pulled the block causing that glitch and will work on it later. So it should be ok for now. It's a dropdown quick login box, not sure why it decided to vomit all over my site. Anyway, I've also updated the default theme's codes with the ones you provided. Still no joy but the default theme is all back in order.

 

I do use Menu Editor Lite. Does the dropdown for the mod have to go in my template_menu()? 

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

Get into the Menu Editor ACP section, add a new button, make it external, send it to urljunkhere?action=characters.

 

There's also some typos in the Display and Post templates, if you need the fixes for those let me know. All that's fixed in the installer, now, too.

 

As far as I can tell with your theme issue, I can't say much beyond this without seeing the actual code, but the first threadList_grid.threadBox div isn't closing properly before opening another, so it is nesting in itself and screwing up. Not sure why it's doing it on one board and not the rest, but there is this peculiarity where the ones that aren't mucked up have threadList_item.infocell but the one that is doesn't, so my best blind guess there is an important div erroneously connected to a conditional that's causing it not to print when it should.

If you want, you can attach your messageindex.temp for me and I can have a peek at it.

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

😍😍😍😍 The mod seems to be working perfectly now. All set up where I wanted it. I don't know what is causing that login glitch. I'll have to dig around with it and see. I took a long break from coding this theme so no telling when it started doing that. 😕  

 

As for my second problem: I did have some issues with my divs closing in the right order when I coded it up. I was hoping I had finally gotten it right but evidently not. Thank you so much for be willing to take a peek. We appreciate all the help you've given us with Witchlight and our new project too. You rock. My MessageIndex.Template looks like this. 

 

<?php
/**
 * Simple Machines Forum (SMF)
 *
 * @package SMF
 * @author Simple Machines
 * @copyright 2011 Simple Machines
 * @license http://www.simplemachines.org/about/smf/license.php BSD
 *
 * @version 2.0
 */

function template_main()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    
    
    // Create the button set...
    $normal_buttons = array(
        'new_topic' => array('test' => 'can_post_new', 'text' => 'new_topic', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0', 'active' => true),
        'post_poll' => array('test' => 'can_post_poll', 'text' => 'new_poll', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'),
        'notify' => array('test' => 'can_mark_notify', 'text' => $context['is_marked_notify'] ? 'unnotify' : 'notify', 'image' => ($context['is_marked_notify'] ? 'un' : ''). 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id']),
        'markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;' . $context['session_var'] . '=' . $context['session_id']),
    );
    
    template_button_strip($normal_buttons);

    // They can only mark read if they are logged in and it's enabled!
    if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
        unset($normal_buttons['markread']);

    // Allow adding new buttons easily.
    call_integration_hook('integrate_messageindex_buttons', array(&$normal_buttons));


    if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
    {
        echo '
    <div id="board_', $context['current_board'], '_childboards">
        <div class="table_frame">
            <div id="board_', $context['current_board'], '_children" class="content">';

        foreach ($context['boards'] as $board)
        {
            echo '
                <div id="board_', $board['id'], '" class="childfrmHolder">
                    <div class="frmWhiteBox">
                                                        <a class="frmChildTitle" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>
                        <div class="frmMarker">
                           <a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
                           
                            if ($board['new'] || $board['children_new'])
                                 echo '
                                <img src="http://www.operationbowtruckle.com/Themes/obb/images/newpost.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
                                
                            elseif ($board['is_redirect'])
                                 echo '
                                <i alt="', $txt['redirect'],'" title="*" class="fas fa-arrow-circle-right"></i>';
                            else
                                 echo '
                                <img src="http://www.operationbowtruckle.com/Themes/obb/images/nonew2.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />
                            </a>
                        </div>
                        <div class="frmChildDesc">
                            ', $board['description'] ,'
                        </div>   
                    </div>';

            // Has it outstanding posts for approval?
            if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
                echo '
                        <a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';


            // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
            if (!empty($board['moderators']))
                echo '
                        <p class="moderators">', count($board['moderators']) === 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

            // Show some basic information about the number of posts, etc.
            echo '

                    <div class="frmDetails">
                        ', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' ', '&#38' ,'
                        ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
                    </div>';

            /* The board's and children's 'last_post's have:
            time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
            link, href, subject, start (where they should go for the first unread post.),
            and member. (which has id, name, link, href, username in it.) */
            if (!empty($board['last_post']['id']))
                echo '
                        <div class="frm_lastpost">

                        ', $board['last_post']['link'], '<br />
                        ', $txt['by'], '
                        ', $board['last_post']['member']['link'] , ' <br />
                        ', $board['last_post']['time'],'
                        </div>';

            echo '
                </div>';

            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children']))
            {
                // Sort the links into an array with new boards bold so it can be imploded.
                $children = array();
                /* Each child in each board's children has:
                        id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
                foreach ($board['children'] as $child)
                {
                    if (!$child['is_redirect'])
                        $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
                    else
                        $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

                    // Has it posts awaiting approval?
                    if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
                        $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

                    $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
                }
            echo '
                    <div id="board_', $board['id'], '_children">
                        <div class="frmsubs">
                            <strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '
                        </div>
                    </div>';
            }
        }
        echo '
            </div>
        </div>
    </div>';
    }
    
    if (!$context['no_topic_listing'])
    {
        echo '
    <div class="pagesection">
        <div class="pagelinks floatleft">
            ', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;
                <a href="#bot"><strong>' . $txt['go_down'] . '</strong></a>' : '', '
        </div>
    </div>';

        // If Quick Moderation is enabled start the form.
        if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
            echo '
    <form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" accept-charset="', $context['character_set'], '" class="clear" name="quickModForm" id="quickModForm">';

        echo '
        <div id="messageindex" class="threadRow_grid">                ';

        // Are there actually any topics to show?
        if (!empty($context['topics']))
        {
            echo '
                    
                <div class="threadRow_gridItem"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=starter', $context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['started_by'], $context['sort_by'] == 'starter' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></div>

                <div class="threadRow_gridItem"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a> / <a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=views', $context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['views'], $context['sort_by'] == 'views' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></div>';

            // Do not show a "select all" box for quick moderation?
            if (empty($context['can_quick_mod']))
                echo '
                <div class="threadRow_gridItem"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></div>';
            else
                echo '
                <div class="threadRow_gridItem"><a href="', $scripturl, '?board=', $context['current_board'], '.', $context['start'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></div>';

            // Show a "select all" box for quick moderation?
            if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1)
                echo '
                <div class="threadRow_gridItem"><input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" /></div>';

            // If it's on in "image" mode, don't show anything but the column.
            elseif (!empty($context['can_quick_mod']))
                echo '
                <div class="threadRow_gridItem">&nbsp;</div>';
        }
        // No topics.... just say, "sorry bub".
        else
            echo '
                <div class="threadRow_gridItem"><strong>', $txt['msg_alert_none'], '</strong></div>';

        echo '
            </div>';

        // If this person can approve items and we have some awaiting approval tell them.
        if (!empty($context['unapproved_posts_message']))
        {
            echo '
                <tr class="windowbg2">
                    <td colspan="', !empty($context['can_quick_mod']) ? '6' : '5', '">
                        <span class="alert">!</span> ', $context['unapproved_posts_message'], '
                    </td>
                </tr>';
        }

        foreach ($context['topics'] as $topic)
        {
             echo '
            <div class="threadList_grid threadBox">
                <div class="threadList_item">
                    <div class="icon1">
                        <img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
                    </div>
                    <div class="icon2">
                        <img src="', $topic['first_post']['icon_url'], '" alt="" />
                    </div>

                        <div class="threadInfo">', $txt['started_by'], ' ', $topic['first_post']['member']['link'],'
                           <small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
                        </div>

                    <div class="threadTitle">
						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
							', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '
						</div>
					</div>
					<div class="threadDesc">
						' . (!empty($modSettings['topic_descriptions_enable']) && $topic['description'] != "" ? '<div class="topicdesc_' . $topic['first_post']['id'] . '">' . $topic['description'] . '</div><br>' : '') . '
					</div>
			';

            // Is this topic new? (assuming they are logged in!)
            if ($topic['new'] && $context['user']['is_logged'])
                    echo '
                        <a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '">
                            <i class="material-icons">fiber_new</i>
                        </a>';

            echo '

                   
	</div>
                                
                        <div class="threadList_item">
                            <div class="threadDetails">
                                <div class="threadDetails1">
                                    ', $topic['replies'], '<br /> ', $txt['replies'], '
                                </div>

                                <div class="threadDetails2">
                                    ', $topic['views'], '<br /> ', $txt['views'], '
                                </div>
                            </div>
                        </div>
                        <div class="threadList_item infocell">
                            <div class="lastpost">
                                <a href="', $topic['last_post']['href'], '">
                                    <img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" />
                                </a>
                                ', $topic['last_post']['time'], '<br />
                                ', $txt['by'], ' ', $topic['last_post']['member']['link'], '
                            </div>
                </div>';

            // Show the quick moderation options?
            if (!empty($context['can_quick_mod']))
            {
                echo '
                    <div class="threadList_item">';
                if ($options['display_quick_mod'] == 1)
                    echo '
                        <input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />';
                else
                {
                    // Check permissions on each and show only the ones they are allowed to use.
                    if ($topic['quick_mod']['remove'])
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=remove;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.gif" width="16" alt="', $txt['remove_topic'], '" title="', $txt['remove_topic'], '" /></a>';

                    if ($topic['quick_mod']['lock'])
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=lock;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.gif" width="16" alt="', $txt['set_lock'], '" title="', $txt['set_lock'], '" /></a>';

                    if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
                        echo '<br />';

                    if ($topic['quick_mod']['sticky'])
                        echo '<a href="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], ';actions[', $topic['id'], ']=sticky;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="', $txt['set_sticky'], '" title="', $txt['set_sticky'], '" /></a>';

                    if ($topic['quick_mod']['move'])
                        echo '<a href="', $scripturl, '?action=movetopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt['move_topic'], '" title="', $txt['move_topic'], '" /></a>';
                }
                echo '
                    </div>';
            }
            echo '

    </div>';
        }

        if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']))
        {
            echo '
                <tr class="titlebg">
                    <td colspan="6" align="right">
                        <select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
                            <option value="">--------</option>', $context['can_remove'] ? '
                            <option value="remove">' . $txt['quick_mod_remove'] . '</option>' : '', $context['can_lock'] ? '
                            <option value="lock">' . $txt['quick_mod_lock'] . '</option>' : '', $context['can_sticky'] ? '
                            <option value="sticky">' . $txt['quick_mod_sticky'] . '</option>' : '', $context['can_move'] ? '
                            <option value="move">' . $txt['quick_mod_move'] . ': </option>' : '', $context['can_merge'] ? '
                            <option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', $context['can_restore'] ? '
                            <option value="restore">' . $txt['quick_mod_restore'] . '</option>' : '', $context['can_approve'] ? '
                            <option value="approve">' . $txt['quick_mod_approve'] . '</option>' : '', $context['user']['is_logged'] ? '
                            <option value="markread">' . $txt['quick_mod_markread'] . '</option>' : '', '
                        </select>';

            // Show a list of boards they can move the topic to.
            if ($context['can_move'])
            {
                    echo '
                        <select class="qaction" id="moveItTo" name="move_to" disabled="disabled">';

                    foreach ($context['move_to_boards'] as $category)
                    {
                        echo '
                            <optgroup label="', $category['name'], '">';
                        foreach ($category['boards'] as $board)
                                echo '
                                <option value="', $board['id'], '"', $board['selected'] ? ' selected="selected"' : '', '>', $board['child_level'] > 0 ? str_repeat('==', $board['child_level'] - 1) . '=&gt;' : '', ' ', $board['name'], '</option>';
                        echo '
                            </optgroup>';
                    }
                    echo '
                        </select>';
            }

            echo '
                        <input type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" class="button_submit qaction" />
                    </td>
                </tr>';
        }
        echo'
    <a id="bot"></a>';

        // Finish off the form - again.
        if (!empty($context['can_quick_mod']) && $options['display_quick_mod'] > 0 && !empty($context['topics']))
            echo '
    <input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
    </form>';

        echo '
    <div class="pagesection">
        ', template_button_strip($normal_buttons), '
        <div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
    </div>';
    }
    
            if (!empty($settings['display_who_viewing']))
        {
            echo '
                <div class="whos_viewing">';
            if ($settings['display_who_viewing'] == 1)
                echo count($context['view_members']), ' ', count($context['view_members']) === 1 ? $txt['who_member'] : $txt['members'];
            else
                echo empty($context['view_members_list']) ? '0 ' . $txt['members'] : implode(', ', $context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
            echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
                </div>';
        }

    // Show breadcrumbs at the bottom too.
    theme_linktree();

    echo '
    <div class="tborder" id="topic_icons">
        <div class="description">
            <p class="floatright" id="message_index_jump_to">&nbsp;</p>';

    if (!$context['no_topic_listing'])
        echo '
            <p class="floatleft smalltext">', !empty($modSettings['enableParticipation']) && $context['user']['is_logged'] ? '
                <img src="' . $settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' . $txt['participation_caption'] . '<br />' : '', '
                <img src="' . $settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' . $txt['normal_topic'] . '<br />
                <img src="' . $settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' . sprintf($txt['hot_topics'], $modSettings['hotTopicPosts']) . '<br />
                <img src="' . $settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' . sprintf($txt['very_hot_topics'], $modSettings['hotTopicVeryPosts']) . '
            </p>
            <p class="smalltext">
                <img src="' . $settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' . $txt['locked_topic'] . '<br />' . ($modSettings['enableStickyTopics'] == '1' ? '
                <img src="' . $settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' . $txt['sticky_topic'] . '<br />' : '') . ($modSettings['pollMode'] == '1' ? '
                <img src="' . $settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' . $txt['poll'] : '') . '
            </p>';

    echo '
            <script type="text/javascript"><!-- // --><![CDATA[
                if (typeof(window.XMLHttpRequest) != "undefined")
                    aJumpTo[aJumpTo.length] = new JumpTo({
                        sContainerId: "message_index_jump_to",
                        sJumpToTemplate: "<label class=\"smalltext\" for=\"%select_id%\">', $context['jump_to']['label'], ':<" + "/label> %dropdown_list%",
                        iCurBoardId: ', $context['current_board'], ',
                        iCurBoardChildLevel: ', $context['jump_to']['child_level'], ',
                        sCurBoardName: "', $context['jump_to']['board_name'], '",
                        sBoardChildLevelIndicator: "==",
                        sBoardPrefix: "=> ",
                        sCatSeparator: "-----------------------------",
                        sCatPrefix: "",
                        sGoButtonLabel: "', $txt['quick_mod_go'], '"
                    });
            // ]]></script>
            <br class="clear" />
        </div>
    </div>';

    // Javascript for inline editing.
    echo '
<script type="text/javascript" src="' . $settings['default_theme_url'] . '/scripts/topic.js"></script>
<script type="text/javascript"><!-- // --><![CDATA[

    // Hide certain bits during topic edit.
    hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

    // Use it to detect when we\'ve stopped editing.
    document.onclick = modify_topic_click;

    var mouse_on_div;
    function modify_topic_click()
    {
        if (in_edit_mode == 1 && mouse_on_div == 0)
            modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '");
    }

    function modify_topic_keypress(oEvent)
    {
        if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
        {
            modify_topic_save("', $context['session_id'], '", "', $context['session_var'], '");
            if (typeof(oEvent.preventDefault) == "undefined")
                oEvent.returnValue = false;
            else
                oEvent.preventDefault();
        }
    }

    // For templating, shown when an inline edit is made.
    function modify_topic_show_edit(subject)
    {
        // Just template the subject.
        setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 95%;" maxlength="80" onkeypress="modify_topic_keypress(event)" class="input_text" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
    }

    // And the reverse for hiding it.
    function modify_topic_hide_edit(subject)
    {
        // Re-template the subject!
        setInnerHTML(cur_subject_div, \'<a href="', $scripturl, '?topic=\' + cur_topic_id + \'.0">\' + subject + \'<\' +\'/a>\');
    }

// ]]></script>';
}

?>

 

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

I lied. I must have missed the typo in the Display template because when I try to modify a post it gives me an error that there's an extra '<'

 

I figured this part out

Edited by Jones

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

Warning: tired, may be nonsensical, 5 hours of sleep is not conducive to making perfect sense.

 

... oh gosh. Duh. I found it, I'm pretty sure.

						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
							', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '

So this is part of the coding for the subject modify quick-edit; $topic['is_sticky'] ? starts a short-hand conditional, and then does not end it properly, so if a topic is NOT sticky, it continues printing the rest of the topic row coding. If it IS sticky, it cuts off right here. So, at the end of this, add another ' to fully end the sticky conditional. You will probably need to add ',' at the end, most likely, so that it looks like '','

  • Thank you 1

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

Thank you so much Arceus. This has been a great help. Super hyped to finish this puppy up and really get some use out of the mod. Good luck with v3! Can't wait to see what it improves upon. 

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

@Arceus Sorry, but I've got more. 😣 First off, I am not finding a place in the bio-form generator to edit or delete tabs/sections/fields. Maybe I am just too tired to be messing with things. Idk.

 

Also I finally got around to making a test character profile and it isn't letting me post as the character account. When I try it throws this error:image.thumb.png.7cb03b49e3126068802514ce9d67b462.png 

 

The code block its referencing is this:

		if(empty($msgOptions['current_poster']) && !empty($msgOptions['id_character']))
		{
			// Switching from user post to character post, fix user posts.
			$smcFunc['db_query']('', '
				UPDATE {db_prefix}members
				SET posts = posts - 1
				WHERE id_member = {int:id_member}',
				array(
					'id_member' => $posterOptions['id'],       <!-- THIS IS THE LINE FROM THE ERROR -->
				)
			);
		}

 

Thanks again, sorry to be such a pita!

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

For the first one they're there but they depend on an image set existing that apparently didn't get moved to the themes. Should be ... ah jesus where the hell'd they go... found em, so save these two images and you'll need them in /images/charmod in your themes folders.

delete.pngmodify.png

 

The second one happens when a user account that has a post count at 0 (potentially 1) attempts to post with a character account. Just alter the user's post count to a value above 0 and it should go. Is it happening on just post edit or new posts too?

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

Ah I see! The whole images/charmod folder never made it to my custom theme. 🤦‍♀️

 

So, the error only pops up when I try to modify the poster in a post. If I try to make a new thread/post with the character profile, it goes through but posts it as my ooc account no matter what. This made me notice though, that my post count is still 0 on my OOC account even though I have made various posts/threads before we even installed the Char Mod. Same thing for my co-admin's account. Posts counts are not increasing. And since this is the first time I thought about it to check I have no idea if its a new issue or something from the mod. 

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

Ooooo I actually know this one! I had that error, too. 

Change the part that says

WHERE id_member = {int:id_member}',

to

WHERE id_member = {int:id_member} and posts > 0',

You'll want to add and posts > 0 into all three of those sections that subtracts 1.

Link to comment
Share on other sites

Well, artificially raise your post count, and post places, and see, I guess. Annoyingly, I fixed that bug already, but I guess it decided it wanted to be unfixed.

 

When changing the poster, check it on your default theme and look in the messages table, make sure the id_character field in the database is getting a number. 

 

How do you guys get these errors anyway, smh, it works perfectly for me. Lol I'm its mom I guess. 

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

Sorry 😶 It just loves you best and SMF likes to give me shyt. "oh you thought you had this figured out mwahahahaha"

Anyway, here is what is happening since I changed the code Snickerdoodle provided:

 

I can now change the poster by modifying the topic, and from Display view the poster is changed. From the message index view it still shows as my ooc account posted it. Weirdly, the post count for that character account is at 8. Which I think should actually be the ooc account post count. Which remains at zero, even after I manually changed it via account settings. This is happening on default curve and my custom theme. 

 

I went into my database and the id_character field does have the number 1 in it. 

 

On the positive side I mostly love it anyway, and no one will ever be able to say you give less than excellent SMF support. We appreciate you. *offers cookies and gentle pats*

 

I did not realize the mod had a topic description bit written in *_* Yay! I pulled out the mod I was using for it and it's working fine on my display.template but is it $context['topic_description'] for MessageIndex view too? 

  • Agree 1

 

operation: bowtruckles & bombs

R6MmD.png

Link to comment
Share on other sites

Iiiiee lemme look really fast, that should be the description variable, but I don't make any promises that it's actually there, because apparently a lot of this mod is missing from the installer (and that's just... akslbsjkdgfsjkdfjk really frustrating because I wrote the installer off the 2.1 version so it should all be in there, gfdi).

 

UM. In the meantime, the mod shouldn't be swapping post counts like that, if that's what it's doing, the only thing I can think of that would cause that is it had a hangup on something re: editing posts and attributed too many posts from OOC account to character. (Fully possible, to be fair about it.) Easy enough to fix, though. (On ACM3, I'm just tossing that entire control, OOC accounts get all their post numbers idefc, it's too delicate and breaks too easily lol.)

Also to get the, hang on lemme find the code off my board, for some reason it doesn't do this automatically and I also don't know why c'est la vie (this dang thing's making me look like a really shit coder right now).
So for this:

',$topic['last_post']['member']['link'],'

It needs to look like this:

',(!empty($topic['last_post']['character']['link']) ? $topic['last_post']['character']['link'] : $topic['last_post']['member']['link']),'

This replaces the last poster username and link with the character name and link if it exists and if this EVEN FRIGGIN BUSTS on you Im gonna flip a table. xD

 

Okay. Uh. The answer is it should be pulling description and date on the message index, yes, but it should be $topic['description'] and $topic['date'] I believe (latter's still an array).

 

I'm sorry it's being such a jerk to you guys, seriously. It wasn't this mean to me when I installed it. It worked almost flawlessly out of the box for me. If it's any consolation though, I feel your pain, and I could really use a shot of vodka rn rofl

nusignature.png nusignature.png

I am the darkness, always watching, always listening, ALWAYS THERE.
(If you're interested in Plain of Ice, message me, it's private. Bleach site, non-canon.)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.