EDIT : 23 Sept 2010.
This package/block code has now been updated for SMF2.
I've moved all the code into the newer block area - instructions are now there at :
http://www.tinyportal.net/index.php?topic=33219
Thank you once again, freddy888.
Testing it right away! :)
Excellent!
Works perfect but I have a problem.
It seems that mouseovertabs.js cause an error in mootools.js that run before the Mouse over tabbed block in my frst page slideshow...
When I move the slidshow block *down* (after the Mouse over tabbed block) then it is working ok.
But I wouldnt like to change their position...
Did I mention that this confict occurs ONLY IN INTERNET EXPLORER 8, 7 and 6? :tickedoff: :tickedoff: :tickedoff:
Mate, this is exactly what I was looking for.
Thank You all very much :)
Cheers
You're welcome Sabre :)
Ok dimdom, I had it in the back of my mind that mootools would cause a problem and that's typical of IE.
Firstly did you test it in the 'ietester' program ? If so then did you also try it in a 'real' standalone version of IE - I ask this because sometimes ietester is just not right.
If it is affected by order that gives me hope - maybe there is some way we can change the order of the javascript. Where about's in your code is the mootools.js loaded ? I mean is it in the slideshow block or is it in the HTML header ?
Also what type of slideshow is it ? I'm guessing it might be 'smooth gallery' ?
Firts of all, I would like to thank you once again for your time in this.
I use this Slideshow code:
http://www.hotajax.org/mootools/photos-other-plugins/619-tpnice-slideshow.html
and the code is is an block (including the mootools.js)
This is the first lines of code in my frontpage block:
<?xml version="1.0" encoding="utf-8"?><!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" xml:lang="en-gb" lang="en-gb" dir="ltr" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Slideshow</title>
<script type="text/javascript" src="http://www.mysite.com/forum/slishow/files/mootools.js"></script>
<link rel="stylesheet" type="text/css" http://www.mysite.com/forum/slishow/files/tpniceslideshow.css" title="default" />
<script type="text/javascript" src="http://www.mysite.com/forum/slishow/files/tpniceslideshow.js"></script>
Whta do you think?
You are welcome :)
OK thanks, I will download that slideshow and try to replicate the problem. And the problem still persists in a standalone version of IE ?
Sorry...what I think is...
As it seems to be the order of the code, then my first idea was to move the call to the mouseover tabs javascript into the top of the index.template.php So that would mean taking it out of the block, if that makes sense - that way it gets loaded/called first. This is just a guess because I don't know much about javascript.
Yes.
There is no problem in Safari, Firefox, Opera and Crome.
Actually it might be quicker if you try moving the javascript youself.
So remove this code from the block :
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
And go to your Theme's index.template.php...
Find (near the top):
<title>', $context['page_title'], '</title>';
And paste in that code before it instead.
So it's like this :
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<title>', $context['page_title'], '</title>';
Try that for now.
Hmm, well I downloaded the slideshow and set it up on my 0.9.8 forum. I put the HTML code for it into a scriptblock and it works fine in IE 7. So I can't replicate the problem I am afraid.
Did you try moving the javascript yet ? I found it works fine with it in the block or in the header of index.template.php
:buck2:
I just used ietester and it works in IE6 and IE8 too...
You might want to check your code in the slideshow block - look for things like unclosed HTML tags. Run it through an HTML validator if you need to... I'm thinking something may be overflowing into the tabbed block because of the order quirk.
http://validator.w3.org/
freddy888, I tried the first method and still doesnt work.
(See the images from FF and IE8).
I attach the code for my slideshow block:
code removed because it was too big and no useful to anyone but me
I dont think that there is any error in this...
I will try the opposite approach. To put the motool.js in indextemplate. Hope it works.
Nothing wrong with your code. I tried using your actual code here, but it doesn't want to work, even though it has full urls. Maybe you have hot linking turned off ? Could also be language problems too though.
Well, how about we try another approach - save your HTML code for the gallery in an external file rather than have it in a block. And instead use an HTML block and grab it using an iframe...
Something like this :
<iframe src="path/to/slideshow.html" width="100%" scrolling="no" height="300" frameborder="0"></iframe>
It works here, perhaps this will stop it clashing with the other javascript if that's what is happening. It's strange it works for me and not for you though. You have to make sure your paths are still right- but dropping it the root forum directory should be ok.
Only other thing I can think of is have you updated your Java lately ?
But before that maybe you could set it up so I can test it with my version of IE live on your site - just to see if it is a problem with your IE or not.
Hot linking is off. :)
Go ahead and try live now. They are both published in my first page.
It working for me lol... must be something to do with your IE I guess.
There is an error message in the tabs block though.
!!! Thanx! :D
You are right!
I just checked it in my other two pcs and it is working ok.
I dont know what to say...
As for the SSI error, I dont see it in my three computers and in all browsers...
Haha, well at least we figured it out, but I don't know what this error message is meaning :
QuoteNotice: ΤÃÅ' SSI.php δÎÂν μÃâ,¬ÃÅ'ÃÂÃŽÂµÃÆ'ε νά Ã†Î¿ÃÂÄÃÅ½ÃÆ'ει μία Ãâ,¬ÃŽÂµÃÂίοδο λειÄοÃ…ÃÂγίαÂ! ΚάÄι ÄÎÂÄοιο μÃâ,¬ÃŽÂ¿ÃÂεá¿â€" νά Ãâ,¬ÃÂοκαλÎÂÃÆ'ει Ãâ,¬ÃÂοβλήμαÄα ÃÆ'Äήν á¼â,¬Ãâ,¬ÃŽÂ¿ÃÆ'ÃÂÃŽÂ½ÃŽÂ´ÃŽÂµÃÆ'η καί ÃÆ'Πἄλλε λειÄοÃ…ÃÂγίε - Ãâ,¬ÃŽÂ±ÃÂακαλῶ βεβαιÉθεá¿â€"Äε ὅÄι ÄÃÅ' SSI.php Ãâ,¬ÃŽÂµÃÂιλαμβάνεÄαι Ãâ,¬ÃÂίν *á½ÂÄιδήÃâ,¬ÃŽÂ¿Ã„ε* ἄλλο ÃÆ'Ã„ά á¼â,¬ÃÂÇεá¿â€"α ÃÆ'αÂ! in /home/autho5/public_html/SMF/SSI.php on line 167
Unless it's something to do with languages installed or something...
Ohh don't worry, it was because I had an old session in my link. I cleared it and its ok now. Sorry LOL
The bottom line is that you have created a very useful and genious block!
;D Thanks, your site is looking really nice btw, very professional. You just need to fix your IE ;)
Thank you and as for the Internet Explorer, I prefer to let it die... ;D
:D Hahaha, I completely understand..
As un update, I have found out what causes these errors in my IE8.
Somehow, the compatibilty mode was on.
Great disasters (more than 4 hours trying to find out what went wrong with the scripts and codes) happen with small things... :idiot2:
[OT - rant]
IE totally Sux!!!
I hate having to continually alter, change or rewrite just so the crappy IE browser can 'see' something... just had to do about an hours work to some already existing content because IE was not able to see or use said content.. FF had no such problem of course.
[/OT -rant]
Yes I totally agree with you both. IE really does suck. It causes me more problems than anything. What's amazing is Google gives us Chrome only a relatively short time ago and it hasn't got half the problems IE has. If they can do that then why is MS so bad at it given all the time they have had to sort it out ?
:idiot2:
Really really like this block, working fine for me.
But to be honest, i don't want any of the tabs it has there right now :p
is there any way i can edit them and put the content i want in there.
I own a football forum, so i want things like ''Next Match'' etc but im not sure how easy it is or where to start
Yes of course, in theory you can edit anything...
Like I said in the first post :
QuoteThe package installer will create a new folder in your forum directory called 'tabbed_block' - inside there is a file called mouseoverTabContent.php and this is what does all the work to create the tab contents.
So if you look at that php file and read the commentary you will see it is only limited by your imagination. It's really just a base for further work and for people to work whatever they want into it.
One thing to note, is that this block is really designed to pull dynamic information from the forum or TP. Because it relies on an external file it may not be practical if you want it to show constantly hand-edited information - because you would have to keep editing the file. It's really a set-up and forget feature. But you could do things like pull information from a certain board on the forum. So if you posted information on the forum (in say a dedicated board) about the next match it could pull from that.
After thinking some more about this, I figured it probably is a bit more flexible than I just said...
As an example of the process, here's how to add a tab that pulls the contents of a TP HTML article.
Starting out with the initial code as supplied I did this :
Added a new function to the mousoverTabContent.php that grabs the article :
// A TP HTML article...
function mot_TPArticle($articleID)
{
global $settings, $db_prefix;
$tp_prefix = $settings['tp_prefix'];
$result = db_query("SELECT body
FROM {$tp_prefix}articles
WHERE id = $articleID
LIMIT 1",__FILE__, __LINE__);
echo '
<div class="tabsmenucontent" style="padding: 12px">';
while ($row = mysql_fetch_assoc($result))
{
echo html_entity_decode($row['body']);
}
echo '
</div>';
mysql_free_result($result);
}
I added that after the search function - just remember that the main thing is that the function comes before the configuration at the end of the file.
Then I didn't want the 'Tools' tab any more so I commented it out in the configuration area like this :
// Tab 2
//mot_TPTools();
Now I needed to call the new function so I added it at the end of all the other tabs, so it will come up in last place :
// Tab 6
mot_Member();
// Tab 7
mot_Search();
// Tab 8
mot_TPArticle(120);
So now we have a new Tab 8. The function needs to know what article it is supposed to be grabbing so you have to set that in the brackets - so here I am using the article with the id '120'
Finally I went back to the block code in TP and made these changes :
I removed this line, because I don't want the 'Tools' tab anymore...
<li><a href="#" rel="gotsubmenu">Tools</a></li>
And at the end of the other tabs (remembering it will come last) I added a new tab :
<li><a href="#" rel="gotsubmenu">Article</a></li>
So now it looks like this :
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">New Topics</a></li>
<li><a href="#" rel="gotsubmenu">New Articles</a></li>
<li><a href="#" rel="gotsubmenu">New Files</a></li>
<li><a href="#" rel="gotsubmenu">Statistics</a></li>
<li><a href="#" rel="gotsubmenu">Member</a></li>
<li><a href="#" rel="gotsubmenu">Search</a></li>
<li><a href="#" rel="gotsubmenu">Article</a></li>
</ul>
</div>
It's a bit confusing at first, but that's how you do it. Like I said before a lot of block code could be used with this too - it's just a matter of turning them into functions.
The Demo page now shows these edits, you should now see a simple article there in the last tab. - no longer up sorry !
Thanks for the reply Freddy.
But like you said i think this is best used as a set up and forget. and i would be looking for one i would be editing regularly . I think it might be easier for me to find a script and install it that way, because to be honest i'm not very good with php coding
No problemo, yes it's a bit PHP intensive. Good luck in finding something that will work for you.
freddy888, hi once again.
This is the code for a php block that grabs new downloads from the Download system mod from http://www.smfhacks.com/
(Found it in a thread in Block code snippets).
It would be a good idea to add this too, as an alternative to TP Downloads.
global $db_prefix, $scripturl;
$cats = array();
$cat = implode(',',$cats);
$categories = '';
if(!empty($cats))
$categories = "AND f.ID_CAT IN($cat)";
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
$categories
ORDER BY f.ID_FILE DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
echo '<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="smalltext"> <a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td valign="top" class="smalltext" align="right">',$row['totaldownloads'],'</td>
</tr>
</table>';
}
I have tried but I failed... It shows in every tab.
Have a good day. :)
dimdom,
Even though the Download Manager from SMF Hacks has a lot of nice features, why would I use that if I had a perfectly good Download Manager which comes bundled with TinyPortal, especially since the code that freddy wrote is designed to be used with TinyPortal.
ZarPrime
Hi ZarPrime, first of all remember that I work with TP 0.9.8 and I will not update to the beta because it doenst give me the opportunity to test it with SMF2. I dont have must time free for updating now, the hard way since my sites are heavily modified, and after a while once again with the newer versions.
So my answer is: for these main reasons:
It has the search function
It has the comments function.
It has the mail notify function.
It has the auto genarated topic function for every file you add to it,
and most of all, because it is already SMF2 compatible, tested and working. :)
Ah, I see. Well, though I don't know that all of these features will be in the Download Manager for TP 1.0 beta 5 in the beginning, that version will have some of these features, include the ability to work with SMF 2.0.
ZarPrime
QuoteIt would be a good idea to add this too, as an alternative to TP Downloads.
Okay, I can have a look at that. I am not familiar with that mod, so I will have to download it and figure it out. May take me a while as I seem to have a lot of things going on at the moment. If you don't hear from me for a while, feel free to jog my memory ;)
Hello,
This is an awesome mod! I have installed it and made some minor modifications according to your directions and it works perfectly. I'd like to see if I can have a tab for Articles in just 1 category, not all. I tried to set a category to the one I want, but I don't really know the code to use and it returns an error on that tab.
The commented line for configuration says:
// $cats = categories to include [changed to use the passed GET variable from the TP block 888]
that line says:
$cats = $categories,
So what should I change that to? Say I want to include only category 10.
Hopefully this makes sense. Thanks for any help!
- Cindi
Sorry, I am officially an idiot :idiot2:
It does clearly state in the php file that you can select the category(s) you want to show in the block code.
I guess it's a case of RTFM!
Thanks for a wonderful mod!
-- Cindi
Haha, yes I did that to make it simpler to change ;D
Glad you figured it out and it works for you...
how can i add html script? like
<iframe name="the_iframe" id="the_iframe" src="http://myforum.smf/index.php?action=shoutbox" allowtransparency="true" frameborder="0" scrolling="no" width="100%" height="195"></iframe> in the function?
Go back and read my example here... it should give you the idea :
http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669
Obviously you will need to echo out the HTML in your new function.
how can we change mouseover tab with clickable tab?
You'd probably need to change the javascript or write your own version with another javascript snippet.
Great work here :) One question - I run into trouble when I try to have two tab blocks. I've tried copying the js and content php files, renaming them and pointing to the new ones from the block, but that doesn't seem to work.
Any help is much appreciated :)
When you say trouble - what exactly do you mean ? Error messages ? If so what are they and when do they occur...more info needed...
Quote from: freddy888 on February 21, 2010, 11:39:31 AM
When you say trouble - what exactly do you mean ? Error messages ? If so what are they and when do they occur...more info needed...
Doh. Trouble means, mouse over doesn't show the tab, only the tab button changes color. And once moused over, it doesn't stay on that tab, just goes to initial state, which is no tab. This is only for the second block on the page - the first tabbed block works fine.
Here's what you need to do:
1) create another mouseoverTabContent.php if you haven't already - give it a new name like mouseoverTabContent2.php - save that near the original one. This example I am using here uses a duplicate of the original - so I get two exactly the same. You can edit it all however you like of course.
2) If you are always going to use two tabbed blocks on the same page then you have to leave out the CSS and Javascript in the second one down, so you will end up with something like this :
// Set which categories you want to pull recent articles from. Comma separated !
$categories = '1,2,3,4';
echo '
<div id="mytabsmenu2" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">New Topics</a></li>
<li><a href="#" rel="gotsubmenu">Tools</a></li>
<li><a href="#" rel="gotsubmenu">New Articles</a></li>
<li><a href="#" rel="gotsubmenu">New Files</a></li>
<li><a href="#" rel="gotsubmenu">Statistics</a></li>
<li><a href="#" rel="gotsubmenu">Member</a></li>
<li><a href="#" rel="gotsubmenu">Search</a></li>
</ul>
</div>
<div id="mysubmenuarea2" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent2.php?categories=' , $categories , '" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
mouseovertabsmenu.init("mytabsmenu2", "mysubmenuarea2", false)
</script>
';
3) Notice I have changed :
<div id="mytabsmenu2" class="tabsmenuclass">
<div id="mysubmenuarea2" class="tabsmenucontentclass">
<a href="tabbed_block/mouseoverTabContent2.php?categories=' , $categories....
mouseovertabsmenu.init("mytabsmenu2", "mysubmenuarea2", false)
This gives you a new instance of the tabbed block with a different id to the first block. I just added a 2 after each one to distinguish them.
4) If you do all that it should work. :)
Also, if you are not going to use the categories feature in the second block then you can just change this line :
<a href="tabbed_block/mouseoverTabContent2.php?categories=' , $categories , '" style="visibility:hidden">Sub Menu contents</a>
into this :
<a href="tabbed_block/mouseoverTabContent2.php" style="visibility:hidden">Sub Menu contents</a>
And then delete this line too as it's not needed :
$categories = '1,2,3,4';
pretty nifty...
Anyway to put it on a timer to rotate?
Quote from: freddy888 on February 21, 2010, 02:35:31 PM
Here's what you need to do:
Brilliant, thanks.
Quote from: freddy888 on February 21, 2010, 02:35:31 PM
2) If you are always going to use two tabbed blocks on the same page then you have to leave out the CSS and Javascript in the second one down
ftfy :)
Thanks alot mate.
Quote from: Xarcell on February 22, 2010, 03:50:17 AM
pretty nifty...
Anyway to put it on a timer to rotate?
I'm sure there is, but I know nothing about javascript so that's something I wouldn't be able to do myself.
Rav33n,
Glad it worked :) Thanks for the note about having to leave out the javascript etc, I wasn't sure, but I figured the second lot would cause a problem.
how can i add this in
mouseoverTabContent.php
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
See here for an example on how to add your own functions :
http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669
TQ..
i have try like
// Grabs mychat...
function mot_chat()
{
echo '
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
}
but did not success
Did you call the function ?
and you added a new tab or replaced an unused one ?
What actually happens when you use your code ?
ok..
i take this code from my upper block that already running wealth..
(without using tabbed)
the chat is running very well..
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
then i change/replace i frame code in my older code in mouseoverTabContent.php
and insert that code above like
// Grabs recent topics...
function mot_chat()
{
echo '
<div class="tabsmenucontent" style="padding: 5px">
<iframe name="the_iframe" id="the_iframe" src="http://samplesite.com" allowtransparency="true" frameborder="0" scrolling="no" width="100%" height="195"></iframe>
</div>';
}
to
// Grabs mychat...
function mot_chat()
{
echo '
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
}
its show nothing.. and other tabs is also missing.
Did you change this section in the block code ? :
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">New Topics</a></li>
<li><a href="#" rel="gotsubmenu">Tools</a></li>
<li><a href="#" rel="gotsubmenu">New Articles</a></li>
<li><a href="#" rel="gotsubmenu">New Files</a></li>
<li><a href="#" rel="gotsubmenu">Statistics</a></li>
<li><a href="#" rel="gotsubmenu">Member</a></li>
<li><a href="#" rel="gotsubmenu">Search</a></li>
</ul>
</div>
So that it shows your new tabs ?
Quote from: freddy888 on March 11, 2010, 07:24:43 PM
Did you change this section in the block code ? :
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">New Topics</a></li>
<li><a href="#" rel="gotsubmenu">Tools</a></li>
<li><a href="#" rel="gotsubmenu">New Articles</a></li>
<li><a href="#" rel="gotsubmenu">New Files</a></li>
<li><a href="#" rel="gotsubmenu">Statistics</a></li>
<li><a href="#" rel="gotsubmenu">Member</a></li>
<li><a href="#" rel="gotsubmenu">Search</a></li>
</ul>
</div>
So that it shows your new tabs ?
i only change the old one.. that is i think i do not need to change/add new one..
You need one for each function you call in the mouseoverTabContent.php file. Is that what you have ?
I think you need to go back and read the example again, it tells you exactly what you need to do.
Also try using this instead :
// Grabs mychat...
function mot_chat()
{
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
}
You don't need to echo globals...
ok nice.. but its now show
Error: No settings.
Sorry try this :
// Grabs mychat...
function mot_chat()
{
global $txt,$context,$boarddir;
echo '
<div class="tabsmenucontent" style="padding: 10px">';
if(allowedTo('yshout_view'))
{
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
echo '
</div>';
}
Also please take a good look at the example function in the mouseoverTabContent.php file....
tq... im still looking..
after change the new code u give me.. its still show now only for one tab
Error: No settings.
What is this yshout ? Is it a mod ?
yes...
http://custom.simplemachines.org/mods/index.php?mod=585#post_advsb
OK thanks - I will download it as see what I can figure out...
Quote from: freddy888 on March 11, 2010, 07:54:50 PM
OK thanks - I will download it as see what I can figure out...
thanks.
What version are you using please ?
Sorry MrCare, I tried to install this but it just wont work for me. This Mod hasn't been updated in a year and I can't get it to work at all. People on SMF seem to be having problems with it so there is little chance I am going to figure this out when I can't even get it to install. I suggest you find another mod or something, sorry my friend.
Hmm... I might try it out on our test forum at Tiny Portal, I forgot about that.... it might not be till tomorrow now though... I will get back to you :)
Quote from: freddy888 on March 11, 2010, 08:53:41 PM
Hmm... I might try it out on our test forum at Tiny Portal, I forgot about that.... it might not be till tomorrow now though... I will get back to you :)
ok.. take ur rest and time.. tq.
Well I had a lot of problems just getting the mod to install and work in a block, but here is a way to do this.
Only one shoutbox on a page seems to work. So if you have a shoutbox at the top of your forum you will have to remove that.
This is simple :
In index.template.php find (if it is there - it is in Default) :
// Show the shoutbox!
shoutbox();
Comment out shoutbox(); So its like this :
// Show the shoutbox!
// shoutbox();
Now the shoutbox should stop appearing at the top of the forum, if it was.
In mouseoverTabContent.php use this code for your new function:
// nneonneo's Shoutbox
function mot_Shout()
{
echo '
<div class="tabsmenucontent" style="padding: 5px">';
// YSHOUT HERE - shoutbox code
global $txt,$context,$boarddir;
if(allowedTo('yshout_view'))
{
echo '<br /><b>',$txt['yshout_shoutbox'],'</b><br /><br />';
echo '<div id="yshout">';
include_once($boarddir.'/yshout/yshout.php');
echo '</div>';
}
elseif($context['user']['is_guest'])
echo $txt['yshout_no_guests'];
// YSHOUT END - shoutbox code
echo '
</div>';
}
Make the adjustments to the order the functions get called and update your tabs in the block code that goes with this, as explained elsewhere (http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669).
Then finally in yshout.php (it's in the yshout folder from your forum root) find the top of the file :
// Figure out where the yshout folder is
global $yshoutdir;
$yshoutdir=(defined('SMF')||isset($yshout_from_index))?'yshout/':'';
// Check configuration files
And insert a couple of lines like shown here :
// Figure out where the yshout folder is
global $yshoutdir;
$yshoutdir=(defined('SMF')||isset($yshout_from_index))?'yshout/':'';
if (!isset($yshout_from_index))
$yshoutdir = '../' . $yshoutdir;
// Check configuration files
Then hopefully it will work. There's a screen shot below of it working in the default theme.
And finally you can help me in return by giving us a link to show it working :) Thanks !
tq.. i will try it after a minutes.. tq for hard job...
yes... very nice job... tq very much.. very glad...
Glad it worked - can you please give us a link so people can see it in action ?
Quote from: freddy888 on March 14, 2010, 03:02:15 PM
Glad it worked - can you please give us a link so people can see it in action ?
I just make a prepare to wait the tp version for smf2.
i think the auto scrollbar having a problem to go down . its still in the top.
editable related link : http://www.simplemachines.org/community/index.php?topic=137508.msg1532028#msg1532028
I need an image of the problem or a link to see what is wrong... if it is a problem with the MOD then try speaking to the mod maker or whoever is doing it now...
ok.. thanks about ur suggestion.. there is better i ask the mod author.. coz this topic is about MOUSE OVER TABBED not for the chat.
Very nice freddy, I downloaded it and will check it more tomorrow, im running the old one i had in a side block now on my dsu forum. I like the look of it great job
Thanks StrormLrd I hope you like what we did with your code - it was a great base to work from. Hopefully I credited you properly in various places if not let me know.
Cheers :)
Not a problem bro, from what ive seen youve done far more with it :D I'll look into more today if my net gets better right now its really crappy lol
I'm having a small problem with some odd behaviour in a tabbed block:
I have a recent topics block (normal php block) that shows a new.gif image next to each topic link on the front page, but the exact same code inside a tabbed block does not show the new.gif image next to unread topics. EDIT: no images at all appear in the tabbed version of the block.
this is the code:
global $scripturl;
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr><td colspan="3" class="titlebg">Recent topics</td></tr> ';
$what=ssi_recentTopics('25', NULL, 'array');
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">
', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['new_from'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle" width="20%">
', $topic['poster']['link'], '
</td>
<td class="windowbg2" valign="middle" width="35%">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
echo '
<span class="smalltext">
', $topic['time'], '
</span>
</td>
</tr>';
}
echo '
</table>';
Basically, the behaviour changes when inside a tabbed block (inside mouseovertabcontent.php) even though the code is exactly the same. I've attached my mouseovertabcontent.php.
Would be very grateful if you could take a look freddy :)
First, well done for figuring out so much already, you did a nice job with this - I know it's not the easiest thing to work with :)
All you need to do here is add a few things to your globals line like so :
global $scripturl, $settings, $txt, $context;
This makes them available for use within a function - each function will need it's own set of globals depending on what you use. You may/will find you need to do something similar with your other functions. The four variables above in that line of code I posted are the main ones usually.
Let me know how you get on, good luck :)
Quote from: freddy888 on March 23, 2010, 12:40:07 PM
Let me know how you get on, good luck :)
Worked. Better support than some paid mods I've tried... ty.
hi, first of all thanks for the code, it is useful as it is.
but i have a few questions:
1.- how can i show articles of an specific category
like tab 8, but no only one, i want to show a bunch of them separated
vertically and sorted from recent to older
----
2.- how can i add this code:
Quoteglobal $sourcedir, $settings;
// show_form = 0 ---> only message without form
// show_form = 1 ---> message + form
// show_form = 2 ---> only form without message
$show_form = 1;
$num_items = 5;
$only_profile = false; // true show only your items, false show all items
if (!allowedTo('smfsocialnetwork_access'))
echo 'Sorry, you cannot access to SMF Social Network';
elseif (!file_exists($sourcedir . '/SMFSocialNetwork.php'))
echo 'No SMFSocialNetwork.php file found';
elseif (!file_exists($sourcedir . '/SMFSocialNetwork-Subs.php'))
echo 'No SMFSocialNetwork-Subs.php file found';
elseif (!file_exists($settings['default_theme_dir'] . '/SMFSocialNetwork.template.php'))
echo 'No SMFSocialNetwork.template.php file found';
else
{
require_once($sourcedir . '/SMFSocialNetwork.php');
smfsocialnetwork_portal_block($num_items, $show_form, $only_profile);
}
already tried but i failed:
Quotefunction mot_Search()
{
global $sourcedir, $settings;
echo '
<div class="tabsmenucontent" style="padding: 5px">'
$show_form = 1;
$num_items = 5;
$only_profile = false; // true show only your items, false show all items
if (!allowedTo('smfsocialnetwork_access'))
echo 'Sorry, you cannot access to SMF Social Network';
elseif (!file_exists($sourcedir . '/SMFSocialNetwork.php'))
echo 'No SMFSocialNetwork.php file found';
elseif (!file_exists($sourcedir . '/SMFSocialNetwork-Subs.php'))
echo 'No SMFSocialNetwork-Subs.php file found';
elseif (!file_exists($settings['default_theme_dir'] . '/SMFSocialNetwork.template.php'))
echo 'No SMFSocialNetwork.template.php file found';
else
{
require_once($sourcedir . '/SMFSocialNetwork.php');
smfsocialnetwork_portal_block($num_items, $show_form, $only_profile);
}
echo '
</div>';
}
i know, i'm not PHP pro.. xD, i just put the code where it says " // All your code goes here..."
and replaced the global..
is not a new entry, i'm replacing search tab because i dont need it
hope to get some help ASAP, thanks =)
this is the MOD
tp 1.0 b4, smf 1.1.11 here
For question one you want to be doing something like this :
This is the new function to go in the mouseoverTabContents.php :
// $category is an array of the categories to pick from.
// $limit is to limit the number of articles shown.
function mot_TPArticlesByCat($category, $limit)
{
global $settings, $db_prefix;
$tp_prefix = $settings['tp_prefix'];
$result = db_query("SELECT body
FROM {$tp_prefix}articles
WHERE category IN (" . implode(',',$category) . ")
ORDER BY date DESC
LIMIT $limit",__FILE__, __LINE__);
echo '
<div class="tabsmenucontent" style="padding: 12px">';
while ($row = mysql_fetch_assoc($result))
{
echo '
<div style="margin-bottom: 10px">
' , html_entity_decode($row['body']) , '
</div>';
}
echo '
</div>';
mysql_free_result($result);
}
You would call that like so in the configuration area :
// Tab 10 or whatever - categories as array, limit number of articles
// eg - categories 4 and 5 with a limit of 6.
mot_TPArticlesByCat(array(4,5),6);
I am not familiar with that mod, I will take a look at it.... a link to wherever it is would be useful... the code itself is not really enough information.
Nevermind I managed to find it. This is the code I used to make it work, firstly the new function :
function mot_SocialNetwork()
{
global $sourcedir, $settings;
echo '
<div class="tabsmenucontent" style="padding: 5px"';
// show_form = 0 ---> only message without form
// show_form = 1 ---> message + form
// show_form = 2 ---> only form without message
$show_form = 1;
$num_items = 5;
$only_profile = false; // true show only your items, false show all items
if (!allowedTo('smfsocialnetwork_access'))
echo 'Sorry, you cannot access to SMF Social Network';
elseif (!file_exists($sourcedir . '/SMFSocialNetwork.php'))
echo 'No SMFSocialNetwork.php file found';
elseif (!file_exists($sourcedir . '/SMFSocialNetwork-Subs.php'))
echo 'No SMFSocialNetwork-Subs.php file found';
elseif (!file_exists($settings['default_theme_dir'] . '/SMFSocialNetwork.template.php'))
echo 'No SMFSocialNetwork.template.php file found';
else
{
require_once($sourcedir . '/SMFSocialNetwork.php');
smfsocialnetwork_portal_block($num_items, $show_form, $only_profile);
}
echo '
</div>';
}
And then in the config area I used :
// Tab 6
mot_SocialNetwork();
Works fine, see image below....
Don't forget about setting up your buttons right.
Hope that helps :)
now, how do you show a PHP article?
You would have to first check what type of article it is (HTML, PHP or whatever) and then I think you would want to use the PHP eval function if it is a PHP article.
You can read up on eval here : http://php.net/manual/en/function.eval.php
wow, that's the nest of every TP/SMF pro!!
THANKS..
does the standard instructions on the original post work on 2.0?
The procedure would be the same, but the code in the external PHP file is for SMF1, so no it would not work. Well at least I don't think it would work, I forget what exactly is in that file.
If you really want it I can update it.
Quote from: Freddy on September 22, 2010, 11:46:18 AM
If you really want it I can update it.
It's up to you freddy... only if you have time to do it mate O0
Ok I will take a look at it later tonight, leave it with me.
Took me a bit longer than expected.
I have turned this thread over into a discussion thread and I've moved the code and instructions for this to the newer block snippets board :
http://www.tinyportal.net/index.php?topic=33219.0
I've done a bit of testing and it seems okay.
@ Freddy,
Nice Bro'. I haven't tried it yet, but great work. O0
ZarPrime
Thank you ZP. I haven't done much coding recently so it was good to get back into some again. :)
Wow thanks again Freddy... i'll consider it a birthday present :P.
Looks great on my site, click my sig to see it.
I wish you was a Spurs fan ;)
Ahha, happy birthday then :)
I do actually like Spurs a lot, always have since I was a kid and they kept winning the FA Cup. I support Norwich City as I was born in Norwich. We're doing really well at the moment (touch wood) but I will always have a soft spot for Spurs and usually watch when they are on the telly.
Just had a look at your site, that fits in nicely. It's always nice to see when these snippets find a good home.
Cheers :)
Freddy. I've been trying this out on two of my testsites running on a xampp local install. SMF2 version
Although the block seems to work fine, there's a error showing at the top of the block.
Quote
Notice: Undefined index: show_download in C:\xampplite\htdocs\forum\Sources\TPSubs.php on line 201
Nothing in error log. Any ideas please?
Hmm, odd, is this at the very top of the block or within the tabs. Screen shot perhaps ?
Nothing in the error log... bah that could mean it's the code in the external file. What version of TP are you on ?
There's no mention of that variable in the external code, so I guess it must be a TP problem.
Bloc, do you have any ideas ?
This is code in an external file and uses TPortal_init(); to link up with TP. Is it possible a variable is not getting set ?
Quote from: Freddy on September 26, 2010, 01:19:36 PM
Hmm, odd, is this at the very top of the block or within the tabs. Screen shot perhaps ?
Sure Freddy, here's two screengrabs from two different test sites. O0
Yeah it's not this block that's doing it directly. It's a possible bug in RC1 I think. I am still using the beta 5.2 here in my test sites and that line does not exist here. But I took a look in the newer TP RC and I can see the line that is causing the problem.
If it's doing that for this block then I would have thought it would be generating some errors normally too in the error log, but it doesn't sound that way.
Not really something I can fix, I would need Bloc to comment. I think we could turn error reporting off just in the external file, but I will need to read up on that, unless anyone else can jump in.
Thanks Freddy.
Now another strange thing. I just installed it on my test site running SMF 1.1.11 and TP1.0RC1 and it's fine. Trouble is I can't remember if this is running TP RC1 test version from the team board, or the official release. :-[
EDIT: Then again this info probably isn't relevant, as looking at the TP.Subs for this version doesn't contain the line that causes this error. :uglystupid2:
This should really be an option of panels..that you could show its blocks as tabs. Maybe not everywhere, but for example only in one place.
Maybe its better to have tab setup as an option for "free panels" (planned for v1.1), which a block could call upon. So a block showing the free xxx_panel in forum only, in the upper panel for example. Sounds useful doesn't it? at least in theory. :)
Oooooh. I love this idea. O0 O0 O0
ZP
Sounds excellent. The more flexible the better IMO. 8) O0
Quote from: Freddy on September 26, 2010, 01:22:37 PM
There's no mention of that variable in the external code, so I guess it must be a TP problem.
Bloc, do you have any ideas ?
This is code in an external file and uses TPortal_init(); to link up with TP. Is it possible a variable is not getting set ?
Bloc, any Ideas on the above please?
Yes, "show_download" is the $context['TPortal']['show_download'] variable, which should also exist in tp_settings table as "show_download". It dictates whether Download manager is on or off.
Check if you got it in the tp_settings table first.
Quote from: Bloc on September 26, 2010, 06:18:10 PM
Check if you got it in the tp_settings table first.
Bloc, I have "show_download" present in both my testsite databases. one turned on =1 one turned off =0
Pretty awesome and just what I was looking for although now that I installed the tabbed menu my image slider which runs on ajax aswell is all messed up. Plz help me out here someone. Take a look at the site and you'll see what I'm talking about.
http://superherocomics.tk/index.php
Well we have no idea what your image slider does or how it was written. Generally if some thing like this happens when you introduce new code to your site, it means there is something that conflicts between the two codes. There's no possible way we could tell what unless we wrote all the code.
Hey guys I'm trying to make the tabs display the "recent 10 posts" from various boards on each tab. Can someone be kind enough to help me out here.
This is my site. I would like to display last 10 posts from like boards DC Movies, Marvel Movies etc.....
I would really appreciate the help guys. :)
Site info:
http://superherocomics.tk/index.php
SMF 2.0RC3
TinyPortal 1.0 beta 5.2
English
Noize
It'd probably help if you showed what code you were using since this topic has a lot of different code snippets in it.
Quote from: IchBin on November 19, 2010, 03:29:51 PM
It'd probably help if you showed what code you were using since this topic has a lot of different code snippets in it.
Well currently i'm using the default code which is:
// Set which categories you want to pull recent articles from. Comma separated !
$categories = '1,2,3,4';
global $boardurl;
echo '
<script type="text/javascript">
var cssNode = document.createElement("link");
cssNode.type = "text/css";
cssNode.rel = "stylesheet";
cssNode.href = "' , $boardurl , '/tabbed_block/tabbedBlockStyle.css";
cssNode.media = "screen";
cssNode.title = "dynamicLoadedSheet";
document.getElementsByTagName("head")[0].appendChild(cssNode);
</script>
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">New Topics</a></li>
<li><a href="#" rel="gotsubmenu">Tools</a></li>
<li><a href="#" rel="gotsubmenu">New Articles</a></li>
<li><a href="#" rel="gotsubmenu">New Files</a></li>
<li><a href="#" rel="gotsubmenu">Statistics</a></li>
<li><a href="#" rel="gotsubmenu">Member</a></li>
<li><a href="#" rel="gotsubmenu">Search</a></li>
</ul>
</div>
<div id="mysubmenuarea" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent.php?categories=' , $categories , '" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", false)
</script>
';I need to recode the whole thing as in I want each tab to display the most recent 10 posts of various boards. I hope you guys know what I mean. I'm really a noob at coding so I would really appreciate the help peepz...I really would :)
Quote from: agent47 on November 18, 2010, 11:18:02 PM
Hey guys I'm trying to make the tabs display the "recent 10 posts" from various boards on each tab. Can someone be kind enough to help me out here.
If you just want to display the 10 most recent topics from a board in a particular tab, just use the code below for that tab (change "$include_boards = 3" to what ever board number you want the topics from).
ssi_recentTopics($num_recent = 10, $exclude_boards = null, $include_boards = 3, $output_method = 'echo');
Scroll to the very bottom of me test site to see what it looks like in a bottom panel block. I't's not really formatted nicely but if you need some special formatting for it, I'm sure someone here could help. Here's the link to my test site to see it at the bottom --> http://talesofthehavenexpanse.com/smf2test/index.php
ZarPrime
Quote from: ZarPrime on November 20, 2010, 01:37:10 PM
Quote from: agent47 on November 18, 2010, 11:18:02 PM
Hey guys I'm trying to make the tabs display the "recent 10 posts" from various boards on each tab. Can someone be kind enough to help me out here.
If you just want to display the 10 most recent topics from a board in a particular tab, just use the code below for that tab (change "$include_boards = 3" to what ever board number you want the topics from).
ssi_recentTopics($num_recent = 10, $exclude_boards = null, $include_boards = 3, $output_method = 'echo');
Scroll to the very bottom of me test site to see what it looks like in a bottom panel block. I't's not really formatted nicely but if you need some special formatting for it, I'm sure someone here could help. Here's the link to my test site to see it at the bottom --> http://talesofthehavenexpanse.com/smf2test/index.php
ZarPrime
ZarPrime, if you could be kind enough to tell me where exactly that piece of code goes?
In the "mouseoverTabContent.php" or the php block that I appended via TinyPortal?
agent47,
Well, I don't have this tabbed block up and running on any of my test sites right now so I'm kind of unfamiliar with it and Freddy is kind of busy right now with a class.
The code in my post above will work in a php block. I assume that this tabbed block has some way of putting code into each of your tabs so it should work fine to place it into one or more of the tabs. I suppose that I could install this tabbed block and figure it out but if you already have it up and working, it will probably be as easy for you to do it as it would me. If you want me to do it, it will have to wait until this weekend or so before I can get to it. I'll mark this topic unread for me so that I'll see it again over the weekend.
ZarPrime
Any code needs to go in the external php file.
There's an example of how to customise this here :
http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669
Sorry that's about all I have time for :o
I'm getting a load.php error after I put this code into a block :( How do I fix this? This is such a unique block.
Quote from: shuban on April 21, 2011, 12:51:11 AM
I'm getting a load.php error after I put this code into a block :( How do I fix this? This is such a unique block.
It usually helps if you post what versions you are using of SMF and TP. It also helps if you post the exact error you are getting. No providing any info doesn't help us to help you.
Quote from: IchBinâ,,¢ on April 21, 2011, 02:07:04 AM
Quote from: shuban on April 21, 2011, 12:51:11 AM
I'm getting a load.php error after I put this code into a block :( How do I fix this? This is such a unique block.
It usually helps if you post what versions you are using of SMF and TP. It also helps if you post the exact error you are getting. No providing any info doesn't help us to help you.
Crap, my apologies. I am using 1.1.13 smf and I am getting these errors on the top:
Notice: Undefined index: BAN_CHECK_IP in /home/biologyf/public_html/Sources/Load.php on line 519
Notice: Undefined index: Newest Topic in /home/biologyf/public_html/Sources/Load.php(2060) : eval()'d code on line 297
And then it's showing the table with all the appropriate information underneath. How do I get rid of those ugly errors?
Thanks for the info Shuban. Can you post the code that you are putting in for the tabs? The errors indicate you have something wrong in the code. I don't see any of those errors in the tab block stuff that Freddy has linked to.
Yes, here it is, thank you:
// Set which categories you want to pull recent articles from. Comma separated !
$categories = '1,2,3,4';
/* ######### CSS for top level tabs ######### */
echo '
<style type="text/css"><!--
.tabsmenuclass ul{
overflow: hidden;
width: auto;
margin: 0px 0px -1px 0px;
padding: 0;
list-style-type: none;
}
.tabsmenuclass li{
float: left;
}
.tabsmenuclass a{
display: block;
padding: 5px 7px;
background: #ddd;
color: #888888;
margin-right: 5px;
text-decoration: none;
font: bold 13px Arial;
}
.tabsmenuclass a:hover, .tabsmenuclass a.selected{
background: #e8e8e8;
color: black;
text-decoration:none !important;
border-top: 1px solid silver;
border-right: 1px solid silver;
border-bottom: 0px;
border-left: 1px solid silver;
}';
/* ######### CSS for sub menu container below ######### */
/* height 224px could also be 'auto' or whatever you like size-wise */
echo '
.tabsmenucontentclass{
clear: left;
background: #E8E8E8;
width: 99%;
height: 224px;
overflow:auto;
padding: 0px;
border: 1px solid silver;
}
.tabsmenucontentclass ul{
margin: 0;
padding: 0;
list-style-type: none;
}
.tabsmenucontentclass li{
float: left;
margin-right: 1em;
}
--></style>
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">Unanswered Questions/Topics</a></li>
<li><a href="#" rel="gotsubmenu">Latest Topics</a></li>
<li><a href="#" rel="gotsubmenu">News Articles</a></li>
</ul>
</div>
<div id="mysubmenuarea" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent.php?categories=' , $categories , '" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", false)
</script>
';
Hmm, those errors report variables that I did not use in my block. It must be some other mod that is causing the errors but I couldn't say which one.
Was thinking - these are probably from other mods that do not make the required changes to SSI.php I think a lot of mod makers over look that as it's not an essential change generally. Since this block relies on SSI it could easily be the problem.
What you could do is look in your index.php (forum root) and see if your mods have added some includes/requires. Normally the default SMF 1 includes look like this (near the top of index.php) :
// And important includes.
require_once($sourcedir . '/QueryString.php');
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Security.php');
Some mods will add further includes.
If there are any extra ones, then adding them also to the SSI.php includes, which is a similar arrangement, might help.
Or the alternative is to declare the missing variables (if they are unset) to zero or empty strings - you could do that in SSI.php possibly, not sure about the scope..
If that makes no sense then please get back to us. But first take a look at your index.php file to see if there are some extra lines there and then post them here.
Thanks for the response. I checked the index.php and found only those:
// And important includes.
require_once($sourcedir . '/QueryString.php');
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Security.php');
:-\
I really like this portal, crap.
Hmm, you could attach your load.php and I can take a look at it.
Load.php is likely not the error. Disabling eval will probably show you the true error.
If you're using SMF1.x you'll need to run this query on your database.
REPLACE INTO smf_settings VALUES ('disableTemplateEval', 1);
When you are done just change the 1 to a 0 and run the query again. After you've run the query the first time the error filename and number should change.
Ah thanks IchBin, yes like he said ;D
Quote from: IchBinâ,,¢ on April 24, 2011, 05:33:35 PM
Load.php is likely not the error. Disabling eval will probably show you the true error.
If you're using SMF1.x you'll need to run this query on your database.
REPLACE INTO smf_settings VALUES ('disableTemplateEval', 1);
When you are done just change the 1 to a 0 and run the query again. After you've run the query the first time the error filename and number should change.
Don't mean to sound like a newbie, but how do I run this query? What do I do? I'm confused. :-[
How to Enable/Disable eval() (http://www.simplemachines.org/community/index.php?topic=290186.0)
Is it possible to use the tab block mod without using the mouseoverTabContent.php file?
For instance, I want to use the block, but I want to create my own tabs. How would I do this?
Here is the code
// Set which categories you want to pull recent articles from. Comma separated !
$categories = '1,2,3,4';
/* ######### CSS for top level tabs ######### */
echo '
<style type="text/css"><!--
.tabsmenuclass ul{
overflow: hidden;
width: auto;
margin: 0px 0px -1px 0px;
padding: 0;
list-style-type: none;
}
.tabsmenuclass li{
float: left;
}
.tabsmenuclass a{
display: block;
padding: 5px 7px;
background: #ddd;
color: #888888;
margin-right: 5px;
text-decoration: none;
font: bold 13px Arial;
}
.tabsmenuclass a:hover, .tabsmenuclass a.selected{
background: #e8e8e8;
color: black;
text-decoration:none !important;
border-top: 1px solid silver;
border-right: 1px solid silver;
border-bottom: 0px;
border-left: 1px solid silver;
}';
/* ######### CSS for sub menu container below ######### */
/* height 224px could also be 'auto' or whatever you like size-wise */
echo '
.tabsmenucontentclass{
clear: left;
background: #E8E8E8;
width: 99%;
height:auto;
overflow:auto;
padding: 0px;
border: 1px solid silver;
}
.tabsmenucontentclass ul{
margin: 0;
padding: 0;
list-style-type: none;
}
.tabsmenucontentclass li{
float: left;
margin-right: 1em;
}
--></style>
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">Recently Updated Topics</a></li>
<li><a href="#" rel="gotsubmenu">Unanswered Questions</a></li>
</ul>
</div>
<div id="mysubmenuarea" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent.php?categories=' , $categories , '" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", false)
</script>
';
There's an example in this thread on how to make your own tabs :
http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669
I don't understand why I can't incorportate ssi_functions in this code:
// Set which categories you want to pull recent articles from. Comma separated !
$categories = '1,2,3,4';
/* ######### CSS for top level tabs ######### */
echo '
<style type="text/css"><!--
.tabsmenuclass ul{
overflow: hidden;
width: auto;
margin: 0px 0px -1px 0px;
padding: 0;
list-style-type: none;
}
.tabsmenuclass li{
float: left;
}
.tabsmenuclass a{
display: block;
padding: 5px 7px;
background: #ddd;
color: #888888;
margin-right: 5px;
text-decoration: none;
font: bold 13px Arial;
}
.tabsmenuclass a:hover, .tabsmenuclass a.selected{
background: #e8e8e8;
color: black;
text-decoration:none !important;
border-top: 1px solid silver;
border-right: 1px solid silver;
border-bottom: 0px;
border-left: 1px solid silver;
}';
/* ######### CSS for sub menu container below ######### */
/* height 224px could also be 'auto' or whatever you like size-wise */
echo '
.tabsmenucontentclass{
clear: left;
background: #E8E8E8;
width: 99%;
height: 224px;
overflow:auto;
padding: 0px;
border: 1px solid silver;
}
.tabsmenucontentclass ul{
margin: 0;
padding: 0;
list-style-type: none;
}
.tabsmenucontentclass li{
float: left;
margin-right: 1em;
}
--></style>
<script src="tabbed_block/mouseovertabs.js" type="text/javascript">
/***********************************************
* Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<div id="mytabsmenu" class="tabsmenuclass">
<ul>
<li><a href="#" rel="gotsubmenu[selected]">Unanswered Questions/Topics</a></li>
<li><a href="#" rel="gotsubmenu">Latest Topics</a></li>
<li><a href="#" rel="gotsubmenu">News Articles</a></li>
</ul>
</div>
<div id="mysubmenuarea" class="tabsmenucontentclass">
<!--1st link within submenu container should point to the external submenu contents file-->
<a href="tabbed_block/mouseoverTabContent.php?categories=' , $categories , '" style="visibility:hidden">Sub Menu contents</a>
</div>
<script type="text/javascript">
//mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout")
mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", false)
</script>
';
Without calling the file mouseoverTabContent.php. In other words, I just want to put my ssi functions inside this code which you put in the tiny portal thing.
Because that was the way it was designed to work. It was something to do with the javascript code I adapted - it required an external file.
If you want to rewrite it then this is the original javascript :
http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm
Hi again,
I worked on this really hard and I finally got to where I want it. Check it out:
http://biology-forums.com/index.php?topic=3100 (http://biology-forums.com/index.php?topic=3100)
However, I have some issues with the tables. I would really like to have a column for the icon, replies, views, and date posted, like I have it on here:
http://biology-forums.com/index.php (http://biology-forums.com/index.php)
Here is the code I'm using, any help would be kindly appreciated.
echo'
<ul id="countrytabs" class="shadetabs">
<li>
<a href="#" rel="country1" class="selected">Unanswered Questions - Be The First To Respond!</a></li>
<li><a href="#" rel="country2">
Latest Articles</a></li>
<li><a href="#" rel="country3">
Recently Updated Topics</a></li>
</ul>
<div style="border:1px solid gray; width:auto; margin-bottom: 1em; padding: 10px">
<div id="country1" class="tabcontent">';
{
global $scripturl, $settings, $context, $txt; $exclude_boards;
$what = ssi_unansweredTopics('5', $exclude_boards = array(2, 15, 16, 17, 21, 22, 29), 'array');
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"><b>Topic</b></td>
<td valign="middle"><b>Board</b></td>
<td valign="middle"><b>Author</b></td>
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg2" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['board']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>';
}
echo '
</div>
<div id="country2" class="tabcontent">';
{
global $scripturl, $settings, $context, $txt; $exclude_boards;
$what = ssi_unansweredTopics('5', $exclude_boards = array(3, 4, 5, 6, 7, 8, 9, 10, 11, 33, 34, 35, 12, 13, 14, 24, 25, 23, 21, 22, 29, 15, 16, 17, 20), 'array');
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"><b>Topic</b></td>
<td valign="middle"><b>Board</b></td>
<td valign="middle"><b>Author</b></td>
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg2" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['board']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>';
}
echo '
</div>';
echo '
<div id="country3" class="tabcontent">';
{
global $scripturl, $settings, $context, $txt; $exclude_boards;
$what = ssi_recentTopics('5', NULL, 'array');
echo '
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"><b>Topic</b></td>
<td valign="middle"><b>Board</b></td>
<td valign="middle"><b>Author</b></td>
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg2" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['board']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>';
}
echo '
</div>';
echo ' <div>
<script type="text/javascript">
var countries=new ddtabcontent("countrytabs")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()
</script>
</div>';
Can someone tell me how to get rid of "TinyPortal 1.0 RC1 | © 2005-2010 BlocWeb" on this block. I don't think it's fair to have this copyright embedded everywhere on the website. :(
Also, I'm finding that every time I post, the content within each tab disappears :( Why is this happening. In other words, I post, and after the page has loaded or returns to the thread, the stuff inside are gone!
Here's the thing guys. I've been using the code snippet that's below but it's funny how when you look at your website everyday, you just have this need to improve the interface and that's why I'm here. If you look at my Tabbed Block on the homepage, it doesn't look perfect.
<?php
// ===============================================================================================
// mouseoverTabContent.php
// 23rd September 2010
//
// Code is based on the work of StormLrd and modifications by dimdom.
// This file pulls together their work and has been assembled by Freddy888.
//
// This file is designed to pull data from an SMF forum and put it in a Tiny Portal tabbed block.
// This uses a modified version of the 'Mouseover Tabs Menu' at
// http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm
//
// Functions are prefixed 'mot_' meaning 'mouse over tab'.
// Basically each function equals one tab contents in your Tiny Portal block code.
// The order in which the functions are called is the order the tabs will appear in.
// You can put whatever you like in these functions or add more,
// this method just makes it easier to move stuff around.
//
// The actual 'output' from this file occurs at the end of this file.
// You can skip down to the bottom to fine tune things...
//
// Functions in this version :
// mot_NewTopics
// mot_TPTools
// mot_NewArticles
// mot_NewFiles1
// mot_NewFiles2
// mot_Statistics
// mot_Member
// mot_Search
// ===============================================================================================
// ****************
// INITIALISATION..
// ****************
// In the block code you can set the categories for the 'New Articles' tab, so you don't have to edit this code.
// This should make it easier to work with this function.
if (isset($_GET['categories']))
// Were some categories sent ?
$categories = explode("," , $_GET['categories']);
else
// if not just do a guess...
$categories = array(1,2,3,4,5,6);
// The mouseover tabs JS code generates a $_GET we don't need at this point it seems.
// We need to empty the $_GET variable here otherwise SMF throws a 'Invalid request variable'.
// See circa line 99 in QueryString.php for more info. 888
$_GET = array();
// Going to need all the useful things in SSI.
require_once('../SSI.php');
// Initialise Tiny Portal.
TPortal_init();
// Work out where all the TP images are....
$tpimagesurl = $boardurl . '/Themes/default/images/tinyportal';
$tpimg['options'] = $tpimagesurl . '/TPoptions.gif';
$tpimg['bullet4'] = '<img src="' . $tpimagesurl . '/TPgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['tpblue'] = $tpimagesurl . '/TPblue.gif';
$tpimg['bullet1'] = '<img src="'. $tpimagesurl . '/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet2'] = '<img src="'. $tpimagesurl . '/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet3'] = '<img src="' . $tpimagesurl . '/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['article'] = $tpimagesurl . '/TParticle.gif';
// *************
// The Functions
// *************
// Grabs recent topics...
function mot_NewTopics()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15',NULL,'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics1()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics2()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics3()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics4()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics5()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics6()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
/*
// An example function...don't forget to call it in the config at the bottom!
function mot_myFunction()
{
global $what $ever $you $need $here;
echo '
<div class="tabsmenucontent" style="padding: 5px">'
// All your code goes here...
echo '
</div>';
}
*/
// *************************************
// And finally output & configuration...
// *************************************
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>';
// Call each function in the order you want them to appear in the tabs.
// This should correspond with what you have in your TP block code too.
// So make sure your tabs are in the same order as these functions.
// mot_NewArticles configuration :
// $mode :
// 1= order by date
// 2= order by comments
// 3= order by views
// 4= order by rating
// 6= order randomly
//
// $limit = number of items
// $cats = categories to include [changed to use the passed GET variable from the TP block 888]
// Others are obvious..
// All boards
mot_NewTopics();
// Comics Discussion
mot_NewTopics1();
// TV, Movies & Music
mot_NewTopics2();
// DC Discussion
mot_NewTopics3();
// DC Movies
mot_NewTopics4();
// DC Movies
mot_NewTopics5();
// DC Movies
mot_NewTopics6();
?>
Will someone please help me make it look just the way it looks on that site. The titlebg on my code snippet too had to be manually done via TP block because I didn't know how to append it via php. Help will be more than appreciate fellas. I know that's some messed up looking code and there's an easier way through all of that. Also since I'm working on a v2.0 of my site I'd like to get all fixes ready for Superhero Alliance v2.0.
Thanks in advance.
I can't help with this at the moment guys, I am too busy working on my own site after a hack, so I will be brief.
Shuban, the extra columns you want are probably in the results returned by SSI - try dumping the result of the array it returns to see what you can use. You can use :
echo '<pre>';
print_r($whateverArrayName);
echo '</pre>';
You could use that in a temporary PHP article for example, just to see what data it returns, obviously you would need to fill the array first like you do in your code.
Also, about the missing stuff - look in your error log for clues if there are any.
agent47, they look pretty similar to me. You just need to adjust css (or use inline styles) to change the colour of the links, text sizes and put some padding around the title bit. And remove or add some style to the cell background in your tables. Pretty basic stuff, you should be able to handle it with a little research.
Shuban, TinyPortal adds it's copyright by modifying the output buffer of SMF. Doing this makes it added to a page where SSI is used. If I figure a way to do this, I'll let you know. For now I don't have the time to work on that. I'll put it in the bugtracker so I won't forget about it though. :D
Thank you,
Now I finally got this to work for me, but my only problems are the disappear tables inside each tab.
For instance, if I post a new topic or add a new reply, after the page returns to the thread, the tables are gone :(
Can someone tell me if this happens to them as well?
<?php
// ===============================================================================================
// mouseoverTabContent.php
// 23rd September 2010
//
// Code is based on the work of StormLrd and modifications by dimdom.
// This file pulls together their work and has been assembled by Freddy888.
//
// This file is designed to pull data from an SMF forum and put it in a Tiny Portal tabbed block.
// This uses a modified version of the 'Mouseover Tabs Menu' at
// http://www.dynamicdrive.com/dynamicindex1/mouseovertabs.htm
//
// Functions are prefixed 'mot_' meaning 'mouse over tab'.
// Basically each function equals one tab contents in your Tiny Portal block code.
// The order in which the functions are called is the order the tabs will appear in.
// You can put whatever you like in these functions or add more,
// this method just makes it easier to move stuff around.
//
// The actual 'output' from this file occurs at the end of this file.
// You can skip down to the bottom to fine tune things...
//
// Functions in this version :
// mot_NewTopics
// mot_TPTools
// mot_NewArticles
// mot_NewFiles1
// mot_NewFiles2
// mot_Statistics
// mot_Member
// mot_Search
// ===============================================================================================
// ****************
// INITIALISATION..
// ****************
// In the block code you can set the categories for the 'New Articles' tab, so you don't have to edit this code.
// This should make it easier to work with this function.
if (isset($_GET['categories']))
// Were some categories sent ?
$categories = explode("," , $_GET['categories']);
else
// if not just do a guess...
$categories = array(1,2,3,4,5,6);
// The mouseover tabs JS code generates a $_GET we don't need at this point it seems.
// We need to empty the $_GET variable here otherwise SMF throws a 'Invalid request variable'.
// See circa line 99 in QueryString.php for more info. 888
$_GET = array();
// Going to need all the useful things in SSI.
require_once('../SSI.php');
// Initialise Tiny Portal.
TPortal_init();
// Work out where all the TP images are....
$tpimagesurl = $boardurl . '/Themes/default/images/tinyportal';
$tpimg['options'] = $tpimagesurl . '/TPoptions.gif';
$tpimg['bullet4'] = '<img src="' . $tpimagesurl . '/TPgoto.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['tpblue'] = $tpimagesurl . '/TPblue.gif';
$tpimg['bullet1'] = '<img src="'. $tpimagesurl . '/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet2'] = '<img src="'. $tpimagesurl . '/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['bullet3'] = '<img src="' . $tpimagesurl . '/TPdivider3.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
$tpimg['article'] = $tpimagesurl . '/TParticle.gif';
// *************
// The Functions
// *************
// Grabs recent topics...
function mot_NewTopics()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_unansweredTopics('5', $exclude_boards = array(2, 15, 16, 17, 21, 22, 29), 'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table cellpadding="0" cellspacing="1" width="100%" border="0">
<tr class="catbg2">
<td class="catbg2" style="text-align:left;" ><b>Subject</b></td>
<td class="catbg2" style="text-align:left;" ><center><b>Board name</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Author</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Date</b></center></td>
<td class="catbg2" style="text-align:left;" ></td>
</tr>';
foreach ($what as $topic) {
$cnt++;
$class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
{
echo '
<tr>
<td class="', $class, '">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="', $class, '"><center>', $topic['board']['link'], '</center></td>
<td class="', $class, '"><center>', $topic['poster']['link'], '</center></td>
<td class="', $class, '" style="text-align:right;">', $topic['time'], '</td>
<td class="', $class, '" style="text-align:center;">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0"/></a>';
} }
echo '
</td>
</tr>
</table>
</div>';
}
// Grabs recent topics 1...
function mot_NewTopics1()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_unansweredTopics('5', $exclude_boards = array(3, 4, 5, 6, 7, 8, 9, 10, 11, 33, 34, 35, 12, 13, 14, 24, 25, 23, 21, 22, 29, 15, 16, 17, 20), 'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table cellpadding="0" cellspacing="1" width="100%" border="0">
<tr class="catbg2">
<td class="catbg2" style="text-align:left;" ><b>Subject</b></td>
<td class="catbg2" style="text-align:left;" ><center><b>Board name</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Author</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Date</b></center></td>
<td class="catbg2" style="text-align:left;" ></td>
</tr>';
foreach ($what as $topic) {
$cnt++;
$class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
{
echo '
<tr>
<td class="', $class, '">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="', $class, '"><center>', $topic['board']['link'], '</center></td>
<td class="', $class, '"><center>', $topic['poster']['link'], '</center></td>
<td class="', $class, '" style="text-align:right;">', $topic['time'], '</td>
<td class="', $class, '" style="text-align:center;">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0"/></a>';
} }
echo '
</td>
</tr>
</table>
</div>';
}
// Grabs recent topics 2...
function mot_NewTopics2()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('5', NULL, 'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table cellpadding="0" cellspacing="1" width="100%" border="0">
<tr class="catbg2">
<td class="catbg2" style="text-align:left;" ><b>Subject</b></td>
<td class="catbg2" style="text-align:left;" ><center><b>Board name</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Author</b></center></td>
<td class="catbg2" style="text-align:left;" ><center><b>Date</b></center></td>
<td class="catbg2" style="text-align:left;" ></td>
</tr>';
foreach ($what as $topic) {
$cnt++;
$class = ($cnt % 2) ? 'windowbg' : 'windowbg2';
{
echo '
<tr>
<td class="', $class, '">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="', $class, '"><center>', $topic['board']['link'], '</center></td>
<td class="', $class, '"><center>', $topic['poster']['link'], '</center></td>
<td class="', $class, '" style="text-align:right;">', $topic['time'], '</td>
<td class="', $class, '" style="text-align:center;">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0"/></a>';
} }
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics3()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,11,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics4()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,10,9,12,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics5()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,15,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
function mot_NewTopics6()
{
global $scripturl, $settings, $context, $txt;
$what = ssi_recentTopics('15', array(2,30,4,3,5,39,40,42,43,45,41,6,34,33,35,25,32,36,17,8,11,10,9,12,14,13,20,37,31,29,38,16,19,27,24,28,46,47,48,49,50,51,52),'array');
echo '
<div class="tabsmenucontent" style="padding: 5px">
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr class="catbg3">
<td valign="middle"></td>
</tr>';
foreach ($what as $topic)
{
echo '
<tr>
<td class="windowbg" valign="middle">', $topic['link'];
// Is this topic new? (assuming they are logged in!)
if (!$topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $scripturl, '?topic=', $topic['topic'], '.from', $topic['time'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="new" border="0" /></a>';
echo '
</td>
<td class="windowbg2" valign="middle">', $topic['poster']['link'], '</td>
<td class="windowbg2" valign="middle">', $topic['time'], '</td>
<td class="windowbg2" valign="middle">';
if ($settings['images_url'] != $settings['theme_url'] . '/images' || file_exists($settings['theme_dir'] . '/images/icons/last_post.gif'))
echo '
<a href="', $topic['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="Last Post" title="Last Post" border="0" style="float: right;" /></a>';
}
echo '
</td>
</tr>
</table>
</div>';
}
/*
// An example function...don't forget to call it in the config at the bottom!
function mot_myFunction()
{
global $what $ever $you $need $here;
echo '
<div class="tabsmenucontent" style="padding: 5px">'
// All your code goes here...
echo '
</div>';
}
*/
// *************************************
// And finally output & configuration...
// *************************************
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>';
// Call each function in the order you want them to appear in the tabs.
// This should correspond with what you have in your TP block code too.
// So make sure your tabs are in the same order as these functions.
// mot_NewArticles configuration :
// $mode :
// 1= order by date
// 2= order by comments
// 3= order by views
// 4= order by rating
// 6= order randomly
//
// $limit = number of items
// $cats = categories to include [changed to use the passed GET variable from the TP block 888]
// Others are obvious..
// All boards
mot_NewTopics();
// Comics Discussion
mot_NewTopics1();
// TV, Movies & Music
mot_NewTopics2();
// DC Discussion
mot_NewTopics3();
// DC Movies
mot_NewTopics4();
// DC Movies
mot_NewTopics5();
// DC Movies
mot_NewTopics6();
?>
I have tried to install this mod, but get the error: The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
I use SMF 2.0.2 and TP 1.105. I have emulated SMF 2.0 and 2.0.1, with no luck.
Any suggestion anyone?? :)
Quote from: Dylert on October 06, 2012, 11:29:11 PM
Any suggestion anyone?? :)
Dylert,
Perhaps. The package-info.xml file for this mod doesn't specify either SMF 2.0, 2.0.1, not 2.02. The code is below ...
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">
<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
<name>TP Tabbed Block</name>
<id>Various:TPTabbedBlock</id>
<version>1.0.0</version>
<type>modification</type>
<install for="2.0 RC2">
<readme type="file" parsebbc="true">readme.txt</readme>
<require-dir name="tabbed_block" destination="$boarddir" />
<code>chmod.php</code>
</install>
<uninstall for="2.0 RC2">
<remove-dir name="tabbed_block" destination="$boarddir" />
</uninstall>
<install for="2.0 RC3">
<readme type="file" parsebbc="true">readme.txt</readme>
<require-dir name="tabbed_block" destination="$boarddir" />
<code>chmod.php</code>
</install>
<uninstall for="2.0 RC3">
<remove-dir name="tabbed_block" destination="$boarddir" />
</uninstall>
</package-info>As you can see, only 2.0 RC2 and 2.0 RC3 are specified for the install. I can't guarantee that this mod will work for newer versions of SMF than those two but try emulating "SMF 2.0 RC3" and let us know if it works.
ZarPrime