Re: World of Mendal...
 
Notifications
Clear all

Re: World of Mendala SMF FORUM HELP

89 Posts
6 Users
0 Reactions
38.3 K Views
(@olandir)
Posts: 44
Eminent Member
 

you know what... it may be because you haven't loaded the "header" of the forum in efiction.

That's just a guess, but i believe when you load the header it also loads all of the variables from SMF. That was the first thing I ever did (make it so my smf header was loaded in my efiction header) and everything else was after that.

If that doesn't work, let me know. Sorry you're having problems


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 11:20 am
(@confuzed)
Posts: 66
Trusted Member
Topic starter
 

um ok, I copied your code and changed to my theme number, but now I have a whole lot of undefined index errors at the top of efiction which are all to do with tiny portal, which I have installed, and the theme.

The theme in question is the default on the forum and there are not any errors in it, but somehow it doesnt like it here.  I can see the forum header and the navigation bar.

Do I have to do anything with the ssi as I have not used it before?  Is there anything else involved in it other than copying what you have above to efiction?

oh and the errors are like this and all in the index.template.php file:

Notice: Undefined index: TPortal_front_type in /home/*/public_html/forum/Themes/BA/index.template.php on line 717

Notice: Undefined index: TPortal in /home/*/public_html/forum/Themes/BA/index.template.php on line 836

Notice: Undefined index: TPortal in /home/*/public_html/forum/Themes/BA/index.template.php on line 838

the theme I use is just a copy of the smf default theme in another colour.

If I'm using ssi, do I not have to make an ssi file somewhere or is all I have to do, what is in your post?  πŸ˜•


 
Posted : 31/05/2007 12:16 pm
(@olandir)
Posts: 44
Eminent Member
 

Um, I'm not sure. I've never used tiny portal before (I didn't eve think it worked in 1.1.2) so I have no idea.

But I am going to take a guess at this.

Your theme has variables in it that relate to tinyportal. Most likely... those variables are not being defined when the ssi.php is calling for your theme because they are not part of the normal set of variables being called by the ssi.php. So those variables need to be called in whatever function in ssi.php is responsible for calling the header.

(I'm actually using the exact logic that I use to troubleshoot problems like this).

What I would do is look at the index.template.php and specifically the template_main_above function and see what is being called $global at the top of function. Then look in ssi.php and see how the header gets called (probably a function or something similar) and make sure those same variables are being globally called.

Now, if that didn't make any sense, I can help you figure out where the problem is, just not now (I'm at work), but if you send me your index.template.php file, I should be able to figure out the problem later this evening when I get home.


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 12:25 pm
(@confuzed)
Posts: 66
Trusted Member
Topic starter
 

each one of the undefined index errors relates to the code that tiny portal inserts into the index.template.php which could be a left sidebar or a right sidebar and also a 'home' tab as well as a 'forum' tab.  for each of those things that's where it is going wrong.

Currently it is displaying the site header banner, and the navigation bar with all of those errors mixed in, but it shows only the 'home' tab on the navigation bar and not the 'forum ' tab since its having problems with TP.

I don't really want all the header stuff but the forum login box 'welcome guest login or register' looks good on yours, and better than then efiction set up, so that would be nice to have.  I just dont know how to get around the TP issues. 

Here is the template_main_above section of index.template.php

// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
<meta name="robots" content="noindex" />', '
<meta name="keywords" content="book group, online book group, book discussion, writing group, harry potter, laurell k hamilton, charlaine harris, kelley armstrong, jim butcher, scifi, cats, empire, cat empire, fantasy, kim harrison, reading group, books, authors, arcade, banners, signature banners, icons, tags, avatars, PS, PSP, tutorials, glitter, glitter maker, gallery, blog, screencaps, actors, droolworthy, dresden files, jennifer crusie, j.k. rowling, simon r green, fanfic, fanart, fanfiction, book addict, book addiction, smfshop, rpg, buffy, angel, firefly, serenity, lord of the rings, eragon, critique, showcase, writing prompts, writing exercises, creative, book buddy, book reviews, amazon, cafepress, art, illustrator, comic, graphic novel, artist, PS brushes, deviantart, nanowrimo, pub quiz, stock photos, glitter text, movies, film, heroes, prison break, anime, manga, stargate, atlantis, scrapbooking, vampires, supernatural, preternatural, apocalyptica, mika, christian kane, james marsters, spike, photoshop creative, photoshop, PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src=""'," $settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
var smf_charset = "', $context['character_set'], '";
// ]]></script>
<title>', $context['page_title'], '</title>';

// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href=""'," $settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href=""'," $settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href=""'," $settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href=""'," $scripturl, '?action=help" target="_blank" />
<link rel="search" href=""'" . $scripturl . '?action=search" />
<link rel="contents" href=""'," $scripturl, '" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href=""'," $scripturl, '?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href=""'," $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href=""'," $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href=""'" . $scripturl . '?board=' . $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_leftbar = ', empty($options['collapse_leftbar']) ? 'false' : 'true', ';

                function shrinkHeaderLeftbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "', $context['session_id'], '");';
        echo '
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
      <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_rightbar = ', empty($options['collapse_rightbar']) ? 'false' : 'true', ';

                function shrinkHeaderRightbar(mode)
                {';

        // Guests don't have theme options!!
        if ($context['user']['is_guest'])
                echo '
                        document.cookie = "upshrink=" + (mode ? 1 : 0);';
        else
                echo '
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "', $context['session_id'], '");';

        echo '
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{';

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>';

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

function shrinkHeaderIC(mode)
{';

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>';
// TinyPortal start 

//tinyportal start is line 215 and the first undefined index starts on line 216

Sorry to give you more hassle and I appreciate the help.


 
Posted : 31/05/2007 12:39 pm
(@olandir)
Posts: 44
Eminent Member
 

not a problem but I am going to need the entire index.template.php

I will look at this when I get home this evening, but I want the entire file just in case I'm missing something.

also does your template rhave any other files other than index.template.php, I ask simply becaue mine doesn't (it's a very simple template AND I don' thave tiny-portal) so that might be a clue too.


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 12:44 pm
(@confuzed)
Posts: 66
Trusted Member
Topic starter
 

the theme is a copy of the smf default theme, just with different bg colour etc. So it reads everything from the default theme and only has its own style.css and index.template.php.  But there are quite a few edits in it for tiny portal as it does add quite a lot to the layout.

Do I have to have the header info in order for the other things to work as I'm still not sure that I want it because of the way my default efiction theme is designed.  And I'd prefer not to have to modify my index.template.php.

Also I just noticed that it seems to be picking up some of the font colours from smf theme too, is that correct?


 
Posted : 31/05/2007 12:59 pm
(@olandir)
Posts: 44
Eminent Member
 

yes that's correct.

I think you're right. I think I"m wrong about needing the header, I think you just need the variable assignment.

Look at the top of the newstory function in stories that php in the files in my changed files zip. I think what actually needs to happen, in fact I'm sure of it now, is that at the top of the newstory function you need to add the necessary variables to the "global" declaration at the top of the function.

This is what is at the top of my "newstory" function

	global $autovalidate, $sid, $action, $sid, $store, $tpl, $storiespath, $admin, $sitename, $siteemail, $allowed_tags, $level, $admincats, $alertson, $dateformat, $url, $tableprefix, $minwords, $maxwords, $useruid, $userpenname, $charlist, $catlist, $classtypelist, $db_prefix, $user_info, $adminloggedin;

I'm guessing the global statement at the top of yours is different and that's where the problem is... so forget the whole header thing, just undo that, and editing the global statement at the top of the newstory funciton should solve your problem

It looks like i did the same thing in reviews.php... there is no global statement at all (because there are no functions) so at the top of reviews.php  right under

$reviewid = isset($_REQUEST['reviewid']) ? $_REQUEST['reviewid'] : false;
if(!isNumber($reviewid)) unset($reviewid);
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : false;
$item = isset($_REQUEST['item']) ? $_REQUEST['item'] : false;
if(!isNumber($item)) unset($item);

I added

global $user_info;

I'm sorry for sending you on a wild goose chase. I've never had to explain this stuff to anyone before and as you can see, I do a lot of trial and error :).

I'll make sure to go back later and modify my instructions so that they include adding the global variables whereever necessary.


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 1:11 pm
(@confuzed)
Posts: 66
Trusted Member
Topic starter
 

lol ok I got rid of the header stuff and added the same globals as you have and that got rid of all but one of the undefined index errors!  Yay!

Notice: Undefined variable: ID_MEMBER in /home/*/public_html/efiction/stories.php on line 242

any ideas?

(I'm still working in the stories.php and havent gone any further yet)

There's no rush and sorry to hassle you when you are at work


 
Posted : 31/05/2007 1:37 pm
(@olandir)
Posts: 44
Eminent Member
 

ad $$ID_MEMBER to your list of global variables at the top of newstory function.


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 1:42 pm
(@confuzed)
Posts: 66
Trusted Member
Topic starter
 

ad $$ID_MEMBER to your list of global variables at the top of newstory function.

typo?

I added it with one $ (after trying it with two)  lol

Now I have to try and replicate all the recent changes I made to the non bridged version as that was looking pretty nice.  Hopefully I can find my notes and remember what all I did.

I meant to ask you if it is possible to only display the smf login or register box instead of the efiction one, without all the other parts of the smf header, as that is really all I need.

thanks very much for all your help so far.


 
Posted : 31/05/2007 3:32 pm
(@olandir)
Posts: 44
Eminent Member
 

I've never done that... but once you bridge SMF and efiction, the efiction logon will become a logon to smf (or something along those lines)

and yes that was a typo sorry.


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 3:34 pm
(@olandir)
Posts: 44
Eminent Member
 

I'm going to go back and change my original instructions so they are completely correct


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 3:36 pm
(@confuzed)
Posts: 66
Trusted Member
Topic starter
 

oh no, I think there is something wrong with the shop $$$ as everyone seems to be getting money but I am the only one that has posted any stories.  Could it be giving money to everyone?

I only noticed as we have a new member who only joined today and has only posted once, then I looked at others and they are the same.  πŸ˜• 😐


 
Posted : 31/05/2007 7:08 pm
(@olandir)
Posts: 44
Eminent Member
 

Nope, it's something I did wrong... I should have never changed the code from what I had originally. (I changed it recently based on something someone posted in the SMF shop forums)... so let me fix it and I'll get back to it. I'm having the same problem but didn't notice it


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 7:26 pm
(@olandir)
Posts: 44
Eminent Member
 

I'm really sorry about all the errors, if you need help "reversing" the points you accidentally gave everyone and you hae access to your mysql database I can tell you how to do that.

Otherwise.

the change you need to make is in the code used to add money.

I gave you this code

		// Give the user their points
updateMemberData($ID_MEMBER, array('money' => 'money + ' . $points));

Try this instead...

		// Give the user their points
updateMemberData($uid, array('money' => 'money + ' . $points));

notice I changed $ID_MEMBER to $uid, which is a variable from efiction itself. That will make it work correctly. I'm so sorry. I just recently updated the code so I didn't test the changes I made


A. W. G. Coleman
Visit the World of Mendala
Home of the Fantasy/Adventure Series "Quest of the Seal Bearers"
Fanfiction, fanart, contests, prizes!

 
Posted : 31/05/2007 7:51 pm
Page 2 / 6
Share: