MyBB Community Forums
A couple of things I would appreciate some help with - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: A couple of things I would appreciate some help with (/thread-152270.html)



A couple of things I would appreciate some help with - Scribbler397 - 2014-03-26

Hello,

I'm working on modifying a theme for a new forum, and am having a couple of issues.

The first problem I'm having is one that I have had before on another forum, but the way I fixed it last time isn't working this time.

The issue is that the mycode buttons aren't showing up above the text entry fields on the new post and new reply pages.

Here is a picture of what it looks like currently:

[Image: attachment.php?attachmentid=7696&stc=1&d=1395623406]

I added this snippet of code, and the small boxes denoting that there are supposed to be images there went away.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>

Here is what this is supposed to look like on the theme I modified:

http://mods.mybb.com/uploads/previews/37527-1330288506-8.jpg

(I would post it in image tags, but it shows up giant for some reason.)

I know that it is an issue with the jQuery. I looked at the Google Chrome Developer Console, and it told me that the jQuery isn't defined. I can't figure out how to define it though. Here is a link if you want to take a look at the code: http://forumcrossing.com (Theme isn't completely finished being modified yet.) If someone could tell me what code I need to add, and where to add it, that would be wonderful!

---

The second problem I'm having is a more general problem. I'm trying to add the {$welcome} box from the portal on the index as well. I already have a sidebar setup, but I can't figure out how to get {$welcome} box inside of it. I've tried adding {$welcome} to the sidebar area, but that doesn't do anything. I've also tried putting it inside of a box. Also didn't work. If anyone could give me some guidance on that, it would be most appreciated.



Thanks for your help! Smile


RE: A couple of things I would appreciate some help with - Scribbler397 - 2014-03-31

Still need some help...


RE: A couple of things I would appreciate some help with - Scribbler397 - 2014-04-02

Anyone?


RE: A couple of things I would appreciate some help with - Johnny S - 2014-04-03

jqeury and noconflict are included with BF3 theme ( http://forumcrossing.com/jscripts/jquery/jquery.js and related js files are missing).
welcomeblock from portal.php won't work on index (at least not without a core edit).

Open index.php and find (located at the bottom of that php file)

$forums = $forum_list['forum_list'];

and below that code paste this


// Private messages box

// Load global language phrases
$lang->load("portal");

if($mybb->settings['portal_showpms'] != 0)
{
	if($mybb->user['uid'] != 0 && $mybb->user['receivepms'] != 0 && $mybb->usergroup['canusepms'] != 0 && $mybb->settings['enablepms'] != 0)
	{
		switch($db->type)
		{
			case "sqlite":
			case "pgsql":
				$query = $db->simple_select("privatemessages", "COUNT(*) AS pms_total", "uid='".$mybb->user['uid']."'");
				$messages['pms_total'] = $db->fetch_field($query, "pms_total");
				
				$query = $db->simple_select("privatemessages", "COUNT(*) AS pms_unread", "uid='".$mybb->user['uid']."' AND CASE WHEN status = '0' AND folder = '0' THEN TRUE ELSE FALSE END");
				$messages['pms_unread'] = $db->fetch_field($query, "pms_unread");
				break;
			default:
				$query = $db->simple_select("privatemessages", "COUNT(*) AS pms_total, SUM(IF(status='0' AND folder='1','1','0')) AS pms_unread", "uid='".$mybb->user['uid']."'");
				$messages = $db->fetch_array($query);
		}
		
		// the SUM() thing returns "" instead of 0
		if($messages['pms_unread'] == "")
		{
			$messages['pms_unread'] = 0;
		}
		$lang->pms_received_new = $lang->sprintf($lang->pms_received_new, $mybb->user['username'], $messages['pms_unread']);
		eval("\$pms = \"".$templates->get("portal_pms")."\";");
	}
}



RE: A couple of things I would appreciate some help with - Scribbler397 - 2014-04-07

Thanks for the help!

A couple of questions...

For the jquery issue, I re-uploaded the js files from the bf3 theme, and now have the file for the link that you provided, along with any others that came with the theme. The MyCode buttons still aren't appearing. Am I still missing a file?

My next question...

I added the code to the index page, but I can't figure out what I need to put in the sidebar to make the welcome box appear. I tried adding {$welcome}, {$welcome_text}, and simply copying and pasting the contents of the welcome templates (including the welcometexts for both guests and members).

Thanks for your help!


RE: A couple of things I would appreciate some help with - Scribbler397 - 2014-04-15

Bump! See above post.

Thanks!


RE: A couple of things I would appreciate some help with - Johnny S - 2014-04-16

Can you post that code that you pasted in index.php for {$welcome}. And for no editor you have two jquery instances included in headerinclude template (at the bottom of that template remove <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> )


RE: A couple of things I would appreciate some help with - Scribbler397 - 2014-04-17

Here is what I tried for the {$welcome}.

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>{$lang->welcome}</strong></td>
</tr>
<tr>
<td class="trow1">
{$welcome_text}
</td>
</tr>
</table><br />

{$welcome}

I've also tried taking the insides of the welcome_text.php files and copying them onto the index inside a box.


The mycode buttons work now! Thanks so much for all of the help you are giving me. I really appreciate it.