News:

Join the Facebook Fan Page.

Main Menu

TinyPortal

Started by lurkalot, February 12, 2005, 04:43:00 AM

Previous topic - Next topic

ZarPrime


Quote from: MoreBloodWine on September 06, 2010, 04:03:56 AMWhat needs to be changed to take away the hyperlinking of the days that goto a new post page for the mini calendar ?

Everything I've tried either breaks the calendar block or just doesnt work...

global $scripturl;

$now = mktime();
$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 4px 0px 4px;" href="'.$scripturl.'?action=calendar;sa=post;month='.$month.';year='.$year.';day='.$today.'" target="_self">'.$today.'</a>'));

$day_name_length = 3;
$month_href = $scripturl . '?action=calendar';
$first_day = 7;
$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:/eintomark.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>'."\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:4px;\"><a";
if(((($weekday+$first_day) % 7)==0)||((($weekday+$first_day) % 7)==6))
{
$calendar .= ' style="color:#FF0000;"';
}
$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>\n</table>\n";



MoreBloodWine,


If you are using TP 2.0 RC3 and the latest TinyPortal, try the code posted in this post --> http://www.tinyportal.co.uk/index.php?topic=32717.msg262975#msg262975


ZarPrime

MoreBloodWine

#681
Quote from: Kindred on September 07, 2010, 09:55:22 AM
which, to me, indicates a CSS issue....   which is why firebug is your friend.
Maybe so but sometimes I just dont get it, I get the basic idea of it and what its used for but sometimes I just look at it and go WHAAAAAAAAAAAAAT !
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Anpu

Quote from: Bloc on September 05, 2010, 08:53:15 AM
This is a SQL file straight out of a fresh TP install on SMF 2.0RC3. It should work on all SMF2 versions though.

Just import it into phpMyadmin, but remember to change all "smf_tp_" to your prefix first: "{yourprefix}tp_" - if you use anything else than "smf_".
tytytytyty

Just one note: import failed (it said SQL query in line 1 was incorrect) so I copy/pasted everything in SQL, it executed and works!
Thanks Bloc

Akyhne

Bug:

When I do an export of my DB and tries to import it again, I get an error on several tp tables. One of them is:

DROP TABLE IF EXISTS `test_tp_events`;

CREATE TABLE `test_tp_events` (
id int(11) NOT NULL auto_increment,
id_member int(11) NOT NULL,
date int(11) NOT NULL,
textvariable mediumtext NOT NULL,
link mediumtext NOT NULL,
description mediumtext NOT NULL,
allowed mediumtext NOT NULL,
eventid int(11),
on tinyint(4),
PRIMARY KEY (id)
) TYPE=MyISAM;

The last colums is called "on" which is a reserved word in MySql:

wilsy

Hi all,

When I click on a category in downloads I get: -

8: Undefined index: author_id
File: /home/atcoukco/public_html/Sources/TPSubs.php
Line: 2475

Any ideas?



Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

IchBin™

What version of TP and SMF?
IchBin™        TinyPortal

Akyhne

v1.0 beta 5.x... I guess. The mod doesn't tell. SMF2 RC3.

wilsy

Quote from: IchBin™ on September 09, 2010, 11:31:55 AM
What version of TP and SMF?

Hi Ich,

Its SMF 1.1.11 and the latest version of TP.




Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

IchBin™

Yes, that and a few other downloads manager fixes are in the next release.
IchBin™        TinyPortal

wilsy

Thanks Ich,

Is there an iterim fix? I could do with getting my downloads system back up and running :)



Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

IchBin™

It's not running because of that error? You have something else wrong I'm guessing. My downloads still worked, just a layout problem and some undefined errors are there.
IchBin™        TinyPortal

MoreBloodWine

I'm guessing the extra padding I pointed out in the blocks is an "error", is that a planned fix ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


IchBin™

Why would that be an error? It's just stylistic preference. You can change it in the CSS if you don't like it.

.blockbody {
    line-height: 1.3em;
    padding: 8px;
}

Removing the padding: 8px; will cut half of the space you want out.
IchBin™        TinyPortal

MoreBloodWine

Quote from: IchBin™ on September 09, 2010, 01:58:15 PM
Why would that be an error? It's just stylistic preference. You can change it in the CSS if you don't like it.

.blockbody {
    line-height: 1.3em;
    padding: 8px;
}

Removing the padding: 8px; will cut half of the space you want out.
I'm not saying it was an error although I suppose it sounds like I may have been, I just figure the same padding rules would have been used that were used for 098.

Edit: Where specifically is the TP css located ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


IchBin™

If you do not have a tp-style.css file in your custom theme, then it would be in the default themes location.
IchBin™        TinyPortal

MoreBloodWine

Quote from: IchBin™ on September 09, 2010, 02:18:36 PM
If you do not have a tp-style.css file in your custom theme, then it would be in the default themes location.
Thx for that, by changing it to 0px it now has the same padding as 098 ;-)

Edit: What would I look for to apply the same padding to the title area ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


IchBin™

The title area of a block does not have any padding that I can see. It looks like you'll have to remove a < span > tag or two to get the left space to disappear.  I don't know where to find this code at the moment though.
IchBin™        TinyPortal

MoreBloodWine

Quote from: IchBin™ on September 09, 2010, 02:37:24 PM
The title area of a block does not have any padding that I can see. It looks like you'll have to remove a < span > tag or two to get the left space to disappear.  I don't know where to find this code at the moment though.
Ehh, it's not really a big thing with the title, I was more concerned with saving that body space so my blocks don't need to be 16px wider than normal so looks like I'm good, Thx Ichy ;-)

Ok you probably dont like Ichy lol but I had to say it, been wanting to for a while lol

Edit: I actually would like to suggest one thing. Would it be possible to add soemthing to the TP admin area that would allow the CSS to be edited from the web ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


IchBin™

I think Bloc has added all the options he wants for blocks lol. He already gives you like 10 layouts to choose from.  Adding in this would just further complicate it IMO. But I'm not the developer for it. :) If I were you maybe post a feature request in our issue tracker at the tp.net.co.uk site.
IchBin™        TinyPortal

MoreBloodWine

Quote from: IchBin™ on September 09, 2010, 02:49:01 PM
I think Bloc has added all the options he wants for blocks lol. He already gives you like 10 layouts to choose from.  Adding in this would just further complicate it IMO. But I'm not the developer for it. :) If I were you maybe post a feature request in our issue tracker at the tp.net.co.uk site.
I don't mean make the block css editable by the web but rather the whole css file itself.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


Advertisement: