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

Recent

Welcome to TinyPortal. Please login or sign up.

December 09, 2024, 01:28:02 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,443
  • Total Topics: 21,252
  • Online today: 110
  • Online ever: 6,457 (November 30, 2024, 02:40:09 PM)
Users Online
  • Users: 0
  • Guests: 60
  • Total: 60

Einige Frage zu TP 2.1.x

Started by AmaSha, January 06, 2022, 10:38:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AmaSha

Hi.

I am currently using the TinyPortal 2.0.1 in my forum (still SMF 2.0.18, but will be updated to 2.0.19 soon). TinyPortal 2.1.0 is now available for installation.

Of course I would like to integrate this into my forum or update my existing TP accordingly. I therefore have the following questions for the community:

1. Is it advisable to upgrade SMF from 2.0.18 to 2.0.19 first before upgrading TP 2.0.1 to 2.1.0?

2. Can I over-install TP 2.1.0 directly over TP 2.0.1 or do I have to uninstall 2.0.1 first?

3. In TP 0.9.x there was an overview of dates that displayed the current data from the SMF calendar. In TP 2.0.1 I can no longer find this ad. Are they available again in TP 2.1.0?

I thank you in advance for the answers. If my post is wrong at this point, I ask for your forbearance and my post can then be moved to the correct board.

kind regards

AmaSha

@rjen

Q1
That makes no difference

Q2
You must always uninstall TP (without deleting data) before installing a new version.

Q3
Not sure what you are missing exactly, you will need to be more specific
Running Latest TP on SMF2.1 at: www.fjr-club.nl

AmaSha

Hi.

Please excuse my late response to your replies, @rjen.

To question / answer 1: Then I'll go and update SMF first before I then

(Question / Answer 2) uninstall Tiny Portal once and then reinstall (new version). Uninstalling TP 1.0.2 does NOT change the entries in the SQL database (those "tp_..." values)? Or do I have to manually upload them back to the SQL database after reinstalling TP?
Please don't get me wrong, I just find it confusing that I have to uninstall the old version for a TP update. It would be useful if I could simply update the TinyPortal with a patch. But that is probably a matter of opinion.

To question / answer 3: Under TP 0.x.x there was a block that was called (to the best of my memory) "Calendar" and always displayed the current dates (birthdays, appointments, etc.) from the SMF calendar in a small block . It was to read like (from memory): "Future birthdays: * Member 1 (02/30/2020), * Member 90 (04/31/2020)" etc. I cannot find this block in TP 1.0.2 - or I have overlooked it so far? Will it be back if it is currently no longer available? This small schedule overview was very practical and my users were also happy to use it.

Kind regards

Thomas

@rjen

I am pretty sure that there are no standard blocks removed. You sure it was a standard block? Perhaps a php code snippet...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

AmaSha

Well....

As I stated I probably overlooked it. I will investigate after I updated either SMF and TP.

Thanks a lot.

Regards

Thomas

AmaSha

Hi.

I would like to ask two more questions or go deeper.

It says yes, I have to uninstall TinyPortal before updating to a new version. My question about this: Are the SQL-entries for Tiny Portal NOT deleted?

And if I then install a new version of Tiny Portal, will the SQL-entries not be overwritten?

Regarding my question about the TinyPortal calendar block: Yes, the current version I am using (1.0.2) contains a calendar. But it only shows a calendar in "mini format" in one block. In the old version (0.9.x), however, it was the case that in this calendar block no entire MONTH CALENDAR was displayed but only the current date as a small text ("Member One" has birthday (02/30)" or "Radio Fair in Stadtdorf ( 02/14 - 02/19)"). There was this very practical difference in the presentation.

Thanks in advance and kind regards.

Thomas

@rjen

The TinyPortal specific settings are stored in your forum database, the tables that start with tp_

When you uninstall TinyPortal you have an option to choose " remove all data associated with this modification". See the attached printscreen 1.

This is by default not selected, and it you leave it at that all TP tables with their content will stay in your database.

Then when you install the newer version of TinyPortal our installer will check for the existence of the tables, and if they are already there, they will not be overwritten.
It may update the tables definitions if these have changed between versions, but all your data will remain in place... See the attached printscreen 2.

as for the calendar in 0.9, I never yused that old version, so I can check what that was.
I do know that I personally created a block code that will show a combination of the mini month calendar and a list of events.

This code may be usefull to you, but it may require some tweaking for your forum... (see attachment 3 for an example)

By the way. You said befor you were on TP 2.0.1 now you say you are on 1.0.2? Which is it?
Running Latest TP on SMF2.1 at: www.fjr-club.nl

@rjen

As for the calendar. I had a look into the archives of TinyPortal and the oldest version I can find is version 0.983

I have no forum I can install it on and it does not seem to contain any code snippets (these must have come in a later version)
So unless you can post the block code of your old calendar block here there is no way to check it...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

AmaSha

Hi, everyone.

Thank you for your answers, @rjen. (Arjen?)

Well, I now have it about the deinstallation and reinstallation. Thank you very much for the extensive explanations, that helps me very well at the moment (medication makes it difficult for me to concentrate at the moment ... :-(). I wrote it all down and am therefore well prepared for an update.

I am currently using the TinyPortal Version 2.0.1 in SMF 2.0.18 - sorry for that typo. Of course I would like to update to TP 2.1.0 now. You see, my concentration is not the very best.

I checked my backup folder and found the following file:
minicalendar.blockcode, the content of which is as follows:


<info>
TinyPortal BlockCode file.
format: Boardmod
</info>

<name>
Mini calendar
</name>

<author>
Bloc
</author>

<version>
0.1
</version>

<date>
01.oct.2009
</date>

<code>
global $scripturl, $smcFunc;

$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 = 1;
$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   = $smcFunc['htmlspecialchars'](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>'."\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:#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>\n</table>\n";
</code>

<description>
A simple calendar to be used in a php-block, the code is from http://keithdevens.com/software/php_calendar , slightly modified.
It simply displays the date and the days in current month/year. Current day is highlighted.
</description>


Unfortunately, I don't have a screenshot from the old forum anymore, but it showed, as in your screenshot # 3, all upcoming appointments, but WITHOUT the small calendar above (was it as setting?). I was able to set the display period, but now I no longer know exactly whether in the TP block "minicalender" or whether it was a setting in SMF. But that can be surely found using the code above.

So much for my part again and thanks in advance for further answers.

Kind regards and stay safe!

Thomas

AmaSha

Hello.

TinyPortal 2.1.0 is installed and everything seems to run perfect - I havn't detected any bugs so far. If so I shall come back later on that.

What remains is still my question regarding the "Mini Calender" as quoted:

Quote from: AmaSha on January 11, 2022, 09:34:53 AM
...
I checked my backup folder and found the following file:
minicalendar.blockcode, the content of which is as follows:


<info>
TinyPortal BlockCode file.
format: Boardmod
</info>

<name>
Mini calendar
</name>

<author>
Bloc
</author>

<version>
0.1
</version>

<date>
01.oct.2009
</date>

<code>
global $scripturl, $smcFunc;

$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 = 1;
$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   = $smcFunc['htmlspecialchars'](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>'."\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:#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>\n</table>\n";
</code>

<description>
A simple calendar to be used in a php-block, the code is from http://keithdevens.com/software/php_calendar , slightly modified.
It simply displays the date and the days in current month/year. Current day is highlighted.
</description>


Unfortunately, I don't have a screenshot from the old forum anymore, but it showed, as in your screenshot # 3, all upcoming appointments, but WITHOUT the small calendar above (was it as setting?). I was able to set the display period, but now I no longer know exactly whether in the TP block "minicalender" or whether it was a setting in SMF. But that can be surely found using the code above.
...

The contained "mini_calender 2" in TP 2.1.0 only shows a iniature calender but no Birthdays or other dates.

@Admin: You might cut this posting off and move it into the correct thread if necessary.

Thanks in advance.

Kind regards and stay safe.

Thomas