TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

June 26, 2024, 10:22:42 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,280
  • Total Topics: 21,227
  • Online today: 334
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 314
  • Total: 314

Multi-TP Blocks

Started by akulion, December 17, 2006, 10:17:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blue Steel

can't anyone help me out here ??

its really weird .. on the shout page (when i have the main shout page open.) this block works fine .. but not on any other page :(

here is my code .. BTW i've got about 4 blocks using the multi block.. all the others are working fine .. its just this one


echo'
<ul id="maintab2" class="shadetabs">
<li class="selected"><a href="#" rel="tcontent7">Shout</a></li>
<li><a href="#" rel="tcontent8">Calendar</a></li>
</ul>
<div class="tabcontentstyle2">

<div id="tcontent7" class="tabcontent">';
TPortal_shoutbox();
echo'</div>

<div id="tcontent8" class="tabcontent">
<center>';
global $scripturl, $modSettings, $sourcedir;

$now = mktime() + $modSettings['time_offset'] * 3600;
         $today = date('j',$now);
         $year = date("Y",$now);
         $month = date("n",$now);
         $days = array($today=>array(NULL,NULL,'<a class="smalltext" style="color: steelblue; font-weight: bold; border: solid 1px black; background-color: white; padding: 0px 2px 0px 2px;" href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$today.'" target="_self">'.$today.'</a>'));

         $day_name_length = 2;
         $month_href = $scripturl . '?action=calendar';
         $first_day = 0;
         $pn = array();

$first_of_month = gmmktime(0,0,0,$month,1,$year);
#remember that mktime will automatically correct if invalid dates are entered
# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
# this provides a built in "rounding" feature to generate_calendar()

$day_names = array(); #generate all the day names according to the current locale
for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday
$day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name

list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month));
$weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day
$title   = htmlentities(ucfirst($month_name)).' '.$year;  #note that some locales don't capitalize month and day names

#Begin calendar. Uses a real <caption>. See http://diveintomark.org/archives/2002/07/03
@list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable
if($p) $p = '<span class="smalltext">'.($pl ? '<a href="'.htmlspecialchars($pl).'">'.$p.'</a>' : $p).'</span> ';
if($n) $n = ' <span class="smalltext">'.($nl ? '<a href="'.htmlspecialchars($nl).'">'.$n.'</a>' : $n).'</span>';
$calendar = '<table align="center" valign="top">'."\n".
'<caption >'.$p.($month_href ? '<a href="'.htmlspecialchars($month_href).'">'.$title.'</a>' : $title).$n."</caption>\n<tr>";

if($day_name_length){ #if the day names should be shown ($day_name_length > 0)
#if day_name_length is >3, the full name of the day will be printed
foreach($day_names as $d)
$calendar .= '<th class="smalltext" abbr="'.htmlentities($d).'">'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'</th>';
$calendar .= "</tr>\n<tr style=\"text-align:right;\">";
}

if($weekday > 0) $calendar .= '<td class="smalltext" colspan="'.$weekday.'"> </td>'; #initial 'empty' days
for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){
if($weekday == 7){
$weekday   = 0; #start a new week
$calendar .= "</tr>\n<tr style=\"text-align:right;\">";
}
if(isset($days[$day]) and is_array($days[$day])){
@list($link, $classes, $content) = $days[$day];
if(is_null($content))  $content  = $day;
$calendar .= '<td "'.($classes ? ' class="'.htmlspecialchars($classes).'">' : '>').
($link ? '<a href="'.htmlspecialchars($link).'">'.$content.'</a>' : $content).'</td>';
}
else
{
$calendar .= "<td class=\"smalltext\" style=\"padding-right:2px;\"><a";
if(((($weekday+$first_day) % 7)==0)||((($weekday+$first_day) % 7)==6))
{
$calendar .= ' style="color:#C00000;"';
}
$calendar .= " href=\"".$scripturl."?action=calendar;sa=post;month=".$month.";year=".$year.";day=".$day."\" target=\"_self\">$day</a></td>";
}
}
if($weekday != 7) $calendar .= '<td class="smalltext" colspan="'.(7-$weekday).'"> </td>'; #remaining "empty" days

echo $calendar.'</tr>';
#create notice for Holidays, Events & Birthdays.

if (ssi_todaysHolidays('')) {
  echo '<tr><td><hr></td><td colspan="5" class="smalltext" align="center" style="color: #' . $modSettings['cal_holidaycolor'] . ';"><b>Upcomming Holidays</b></td><td><hr></td></tr><td colspan="7" class="smalltext">';
  ssi_todaysHolidays();
  echo '</td></tr>';
}


if (ssi_todaysEvents('')) {
  echo '<tr><td><hr></td><td colspan="5" class="smalltext" align="center" style="color: #' . $modSettings['cal_eventcolor'] . ';"><b>Upcomming Events Today</b></td><td><hr></td></tr><td colspan="7" class="smalltext">';
  ssi_todaysEvents();
  echo '</td></tr>';
}

if (ssi_todaysBirthdays('')) {
  echo '<tr><td><hr></td><td colspan="5" class="smalltext" align="center" style="color: #' . $modSettings['cal_bdaycolor'] . ';"><b>Upcomming Birthdays</b></td><td><hr></td></tr><td colspan="7" class="smalltext">';
  ssi_todaysBirthdays();
  echo '</td></tr>';
}echo '</table>
</center>';

echo'</div></div>';

IchBin

I don't quite get what you're saying. So when you click on the "show last 50 shouts" ? the block doesn't show? Is it the top right block with the shoutbox?

Blue Steel

when i click on show last xx shouts  then the shoutbox block in this script gets populated ..  yes its the top right block

the block shows up on all pages .. just no shouts in the block unless your action begins with ?action=tpmod;sa=shoutbox .. then  and only then the block shows the shouts



catchpen

I'm not sure if this is the same problem Bluesteel is having but -
I was looking into a multi tab block with just a user tab and for the shoutbox too. I got as far as just checking to see if this works as a shoutbox:

TPortal_shoutbox();
or
echo TPortal_shoutbox();

All this gives me is the text field to type in a shout but no way of seeing the previous shouts until I click on view previous 50 shouts or whatever and it shows them all across the page. What part am i missing?  :-\

Thanks.

catchpen

Forgive me for asking again but does anyone know what else i have to add so the multi tab block can have the function of a shoutbox too?

TPortal_shoutbox();
or
echo TPortal_shoutbox();

For a shout box block but that doesn't work but that's all i can find on the search.

koolaid

#75
i have the same problem as catchpen.

I have the shoutbox and stats for a multi block on the top-right. When i tried out the shoutbox, none of the shouts were displayed. No text, just a black background (i'm using a blk theme). You can only see the text field. However, if i click last 50 posts, i can see all the shouts. I used option 1, SMF 1.14, TP 0.9.8. and added TPortal_shoutbox(); to the code.

If you just have a shoutbox block on its own, it works fine.

catchpen

If figured out if you have another TP shoutbox on the same page as the multi block, the shouts show. So for now I have a regular shoutbox on the bottom of my page so the tabbed block shoutbox on the top of the page looks normal.  :-\


koolaid

ah yes you're right that does work. I tried setting the shoutbox to be shown to admin only and have the multi tab for everyone else, but it didn't work XD;

AdviseorAnswers.com

Will someone PLEASE take a look at this and tell me what I did wrong.
My CSS:
/* At-Rules */
@media {
.tabcontent {
display:block!important;
}
}


/* set to left, center, or right to align the menu as desired */
.shadetabs {padding: 2px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 12px Verdana; list-style-type: none; text-align: center;}

.shadetabs li {display: inline-table}

.shadetabs li a {background:  white url('http://www.adviseoranswers.com/Themes/default/images/maintab_back.gif') repeat-x top left; border:  1px solid #778; color: white; margin-right: 1px; padding-bottom: 3px; padding-left: 1px; padding-right: 1px; padding-top: 3px; text-decoration: none}

.shadetabs li a:visited {color: #e70000;}

.shadetabs li a:hover {text-decoration: underline; color: red;}

.shadetabs li.selected {position: relative; top: 1px;}

/* selected main tab style */
.shadetabs li.selected a {background-image: url('http://www.adviseoranswers.com/Themes/default/images/maintab_active_back.gif'); border-bottom-color: #2d2b2b}

/* selected main tab style */
.shadetabs li.selected a:hover {text-decoration: none;}

/* style of tab content oontainer */
.tabcontentstyle {border: 1px solid blue; width: 170px; margin-bottom: 1em; padding: 10px;}

/* style of tab content oontainer */
.tabcontentstyle2 {border: 1px solid blue; width: 170px; margin-bottom: 1em; padding: 10px;}

/* style of tab content oontainer */
.tabcontentstyle4 {border: 1px solid blue; width: 170px; margin-bottom: 1em; padding: 5px;}

.tabcontent {display:none;}

/* End of style section. Generated by AceHTML at 3/26/2008 8:33:54 PM */
/* At-Rules */
@media {
.tabcontent {
display:block!important;
}
}


/* set to left, center, or right to align the menu as desired */
.shadetabs {padding: 2px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 12px Verdana; list-style-type: none; text-align: center;}

.shadetabs li {display: inline; table-layout: auto}

.shadetabs li a {background:  white url('http://www.adviseoranswers.com/Themes/default/images/maintab_back.gif') repeat-x top left; border:  1px solid #778; color: white; margin-right: 1px; padding-bottom: 2px; padding-left: 1px; padding-right: 1px; padding-top: 2px; text-decoration: none}

.shadetabs li a:visited {color: #e70000;}

.shadetabs li a:hover {text-decoration: underline; color: red;}

.shadetabs li.selected {position: relative; top: 1px;}

/* selected main tab style */
.shadetabs li.selected a {background-image: url('http://www.adviseoranswers.com/Themes/default/images/maintab_active_back.gif'); border-bottom-color: #2d2b2b}

/* selected main tab style */
.shadetabs li.selected a:hover {text-decoration: none;}

/* style of tab content oontainer */
.tabcontentstyle {border: 1px solid blue; width: 170px; margin-bottom: 1em; padding: 10px;}

/* style of tab content oontainer */
.tabcontentstyle2 {border: 1px solid blue; width: 170px; margin-bottom: 1em; padding: 10px;}

/* style of tab content oontainer */
.tabcontentstyle4 {border: 1px solid blue; width: 170px; margin-bottom: 1em; padding: 5px;}

.tabcontent {display:none;}

and my PHP Block code:

global $scripturl, $context;

echo'
<head>
<link rel="stylesheet" type="text/css" href="tabcontent.css" />

<script type="text/javascript" src="tabcontent.js">

/***********************************************
* Tab Content script- Ã,© 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 full source code
***********************************************/

</script>
</head>

<ul id="maintab" class="shadetabs">
<li class="selected">
<a href="#" rel="tcontent1">User</a></li>
<li><a href="#" rel="tcontent2">Profile</a></li>
<li><a href="#" rel="tcontent3">Online</a></li>
<li><a href="#" rel="tcontent4">Shout</a></li>
<li><a href="#" rel="tcontent5">Chess</a></li>
<li><a href="#" rel="tcontent6">Search</a></li>

</ul>

<div class="tabcontentstyle2">

<div id="tcontent1" class="tabcontent">';
TPortal_userbox();
echo'</div>

<div id="tcontent2" class="tabcontent">';

echo '
<a href="', $scripturl ,'?action=profile">My Profile</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,';sa=customized">Customize My Profile</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,';sa=pictures;add">Add Profile Photo</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,';sa=pictures">My Pictures</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,';sa=buddies">Manage Friends</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,';sa=comments">My Comments</a><br />
<a href="', $scripturl ,'?action=pm;u=', $context['user']['id'] ,'">My Emails</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,';sa=pmprefs">My Ignore list</a><br />
<a href="', $scripturl ,'?action=profile;u=', $context['user']['id'] ,'sa=forumProfile>My Signature</a><br />
<a href="', $scripturl ,'?action=felblog;u=', $context['user']['id'] .';sa=view">My Blog</a><br />
';

echo'</div>

<div id="tcontent3" class="tabcontent">';
TPortal_statsbox();
echo'</div>

<div id="tcontent4" class="tabcontent">';
TPortal_shoutbox();
echo'</div>

<div id="tcontent5" class="tabcontent">';

echo '

<img src="/Themes/default/SMFChess/chessblock/main.png"/> <a href="', $scripturl ,'?action=chess">My Chess Stats</a><br />
<img src="/Themes/default/SMFChess/chessblock/challenge.png"/> <a href="', $scripturl ,'?action=chess;sa=challenge">Challenge</a><br />
<img src="/Themes/default/SMFChess/chessblock/current.png"/> <a href="', $scripturl ,'?action=chess;sa=current">Current Matches</a><br />
<img src="/Themes/default/SMFChess/chessblock/finished.png"/> <a href="', $scripturl ,'?action=chess;sa=finished">Finished Matches</a><br />
<img src="/Themes/default/SMFChess/chessblock/leaderboard.png"/> <a href="', $scripturl ,'?action=chess;sa=leaderboard">Leaderboard</a><br />
';

echo'</div>

<div id="tcontent6" class="tabcontent">';
TPortal_searchbox();
echo'</div>
</div>

<script type="text/javascript">
//Start Tab Content script for UL with id="maintab" Separate multiple ids each with a comma.
initializetabcontent("maintab")
</script>';


Everything works great in FF but IE shows all the div contents at once....... 
Any ideas???

Nanotek

Stop using IE?  XD    Or hey, you could always use the IE comment-out trick to hide all the neat stuff it doesn't understand   :o    Since I indulged in making a reply, I figured I owed it to you to come up with something actually helpful, so.  Google Is Your Friend

"
   1.  temporarily switch the content's display property to 'block' and back to 'none'.
   2. temporarily switch the content's position property from 'relative' to 'absolute' and back, or vice versa.
   3. temporarily switch the content's  visibility property to 'hidden' and back. (But this only works if the content is positioned absolutely! The wonderful world of IE...)
"