TinyPortal

Development => Support => Installation => Topic started by: AmaSha on January 06, 2022, 10:38:37 AM

Title: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 06, 2022, 10:38:37 AM
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
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 06, 2022, 12:59:47 PM
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
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 08, 2022, 09:58:54 AM
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
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 08, 2022, 10:43:12 AM
I am pretty sure that there are no standard blocks removed. You sure it was a standard block? Perhaps a php code snippet...
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 08, 2022, 11:18:21 AM
Well....

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

Thanks a lot.

Regards

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 10, 2022, 10:44:28 AM
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
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 10, 2022, 11:19:42 AM
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?
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 10, 2022, 11:50:36 AM
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...
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 11, 2022, 09:34:53 AM
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
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 21, 2022, 07:47:36 AM
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
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 21, 2022, 08:00:20 AM
Try my code in a PHP block..

Note: the functions uses the maximum number of days for the board index: events will only show up within this range.

Check your setting for:
"Max days in advance on board index"

global $scripturl, $smcFunc;

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

$day_name_length = 2;
$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).'" style="padding: 4px 2px;">'.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).'" style="padding:1px 6px 1px 1px;">' : ' style="padding:1px 6px 1px 1px;">').
($link ? '<a href="'.htmlspecialchars($link).'?">'.$content.'</a>' : $content).'</td>';
}
else
{
$calendar .= "<td class=\"smalltext\" style=\"padding:1px 5px 1px 4px;font-size: 0.85em;\"><a";
if(((($weekday+$first_day) % 7)==0)||((($weekday+$first_day) % 7)==6))
{
$calendar .= ' style="color:#C00000;"';
}
$calendar .= " href=\"".$scripturl."?action=calendar;sa=view;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";

echo '<br/>';
$result = ssi_todaysEvents('array');

if (!empty($result))
{
   echo '<div class="smalltext"><b>Upcoming events:</b></div>';
   echo '<div class="supersmalltext">';
   foreach ($result as $event)
      {
      $temp = explode('-', $event['date']);
      $event['date'] = $temp[2] . '-' . $temp[1] . '-' . $temp[0];
    echo '<a href="' . $event['href'] . '">' . $event['date'] . ' : ' . $event['title'] . '</a><br />';
      }
   echo '</div>';
}
else
{
      echo '<div class="supersmalltext">There are no upcoming events.<br /><br /></div>';
  }
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 27, 2022, 02:52:41 PM
Hi.

Sorry for the very late reply but I had several appointments with different doctors which made it impossible for me to reply earlier.

First of all, thanks for the code. I put it in the forum as a test and it looks pretty good.

Allow me two comments:

1. Due to the additional calendar, the whole thing looks very bulky, maybe even a bit too big (see IMG_1).

2. There is an appointment (IMG_2) in the SMF calendar for tomorrow (01/28/2022), but it is not (yet) displayed in the small calendar (IMG_3). How can I influence the fact that the appointments are already displayed seven days in advance?

Thanks in advance.

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 27, 2022, 07:14:01 PM
Quote from: @rjen on January 21, 2022, 08:00:20 AM
Note: the functions uses the maximum number of days for the board index: events will only show up within this range.

Check your setting for:
"Max days in advance on board index"


What did you set?
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 08:00:22 AM
Hi @arjen.

This is set to 7 days.

Today it also doesn't show our fourm's tenth birthday. The mini-calender says still "There are no upcoming events." But the date is set to the SMF-calender...
??? ??? ???
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 08:20:15 AM
Can you share a link to you forum?
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 10:11:33 AM
@rjen,

you have a PN...
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 10:36:34 AM
This would be a good explanation...

This block uses standard a SMF SSI function. This means that the users need to be able to see the calendar in order to see the event...

Check the permissions for the users to see the calendar...

Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 10:55:43 AM
Ah, sorry.

You were in the wrong group - the calender is available after 5 posts.

You may try it again, nwo with 100 posts...
;-)
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 11:07:28 AM
I see the calendar now, but I cannot see why it does not work.

The blockcode works fine for me, so I would need to check the block itself and the settings in you forum to get to an explanation...

To do that I would need admin access.
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 11:12:22 AM
@rjen,

you have it!  O0
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 11:44:10 AM
Ok, I see the issue.

The code I provided is used to include EVENTS in the calendar. You only have HOLIDAYS. These are not included. Create an event (I created a test event for you) and it shows...

I changed one setting in the calendar to " Allow events not linked to posts"

By the way I also deactivated the panles in admin sections, because I got a bit claustrofibic...
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 12:06:10 PM
By the way, I would recommend to use the responsive curve mod....
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 02:30:26 PM
Hello @rjen.

Okay, that seems to be working now. But I still have three "luxury problems":

1. The output format of the date. Currently dd-mm-yyy would be better dd.mm.yyyy because it is so common in German-speaking countries.
2. Are the recurring holidays now also being output, or only the manually created appointments?
3. Is it possible to omit the calendar in the block as marked in the attached photo?

What does the Responsive Curve Mod do? Is it absolutely necessary?

Thanks in advance.

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 02:44:55 PM
Date: not sure, but should be possible.

Holidays are not included: this code is only for Events

Yes, you can remove the Calender bit by removing that section from the php code

Responsive curve makes the curve theme adapt to mobile screens. You site is pretty 'messy' when I visit on mobile. Is that required, no. But mobile use is a lot more now then it used to be when curve was developed...
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 02:57:18 PM
Hi @rjen.

Many thanks for your effort.

As far as mobile devices are concerned, we as the "chief desk" in the forum have not yet given it any thought. This has to do with the subject we are addressing: shortwave radio signals. Most of our users, there aren't that many, use our forum directly in their shack, besides the receiver. Many connect the forum to their radio software and have everything on one device - you only need to switch from one application to the next. But I'll make a note of that for our next "patch day" and install accordingly.

Then what part should I delete from the PHP code?

Too bad that the holidays and recurring events are not displayed. That was quite pleasant with the old "mini-calender" under TP 0.9.x. But well, that's the way it is.

Once again I say thank you very much!

Best regards

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 03:00:54 PM
There are ways to show the calender evebts using ssi_ functions. The one I used does only show events though
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 03:08:14 PM
Thanks, @rjen.

I think we'll leave it at that for now. I've already taken up too much of your effort. That's a lot more than I could have expected. Maybe soon then...

Greetings from the north of Germany.

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 04:09:57 PM
Try this (compare to the first code to understand the change)



global $scripturl, $smcFunc;

$result = ssi_todaysEvents('array');

if (!empty($result))
{
   echo '<div class="smalltext"><a href="../index.php?board=28.0"><b>Geplande activiteiten:</b></a></div>';
   echo '<div class="supersmalltext">';
   foreach ($result as $event)
      {
      $temp = explode('-', $event['date']);
      $event['date'] = $temp[2] . '.' . $temp[1] . '.' . $temp[0];
    echo '<a href="' . $event['href'] . '">' . $event['date'] . ' : ' . $event['title'] . '</a><br />';
      }
   echo '</div>';
}
else
{
      echo '<div class="supersmalltext">Er zijn geen evenementen gepland.<br /><br /></div>';
  }
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 04:28:18 PM
Dank U well, @rjen.

Yes, that's roughly what the overview looked like at the time. Excellent!

But these are only the "manually" entered dates, right?

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on January 28, 2022, 04:30:09 PM
Yep, like I said. Just the events
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on January 28, 2022, 04:33:38 PM
@rjen,

I can't thank you enough. That's absolutely great!

Both PHP scripts are stored on my hard drive - in case I want to tinker again. At the moment I would like to leave it with the second script (without the calendar).

Thank you again!

Best regards

Thomas
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on February 09, 2022, 08:04:49 AM
OMG....
:hmm: :hmm: :hmm: :hmm:

Now we've been discussing "my" problem with the calendar box the whole time over and over and pushing code back and forth - the solution is actually RIGHT UNDER THE NOSE!

On the main page of the forum (-> https://www.tinyportal.net/index.php?action=forum) you can see exactly the block I mean. I just didn't notice it because I always stayed in this thread. Title: "Upcoming Calendar" - that's exactly the block I'm missing!

Which one is that in the current TP? I must have been too stupid to find it...
:-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\

Thanks in advance!
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on February 09, 2022, 09:14:16 AM
That is not a block, but the standard SMF infocenter
Title: Re: Einige Frage zu TP 2.1.x
Post by: @rjen on February 09, 2022, 05:04:44 PM
But if you really want a block... plop this into a php block

global $context, $scripturl, $txt;

echo '
<div class="sub_bar">
<h4 class="subbg">
<a href="', $scripturl, '?action=calendar' . '"><span class="main_icons calendar"></span> ', $txt['calendar_upcoming'], '</a>
</h4>
</div>
<p class="inline holiday" style="padding: 2px 0;">
<span>', $txt['calendar_prompt'], '</span><br>
</p>';

ssi_todaysHolidays();

echo '
<p class="inline" style="padding: 2px 0;">
<span class="event">', $txt['events_upcoming'], '<br></span>';
ssi_todaysEvents();
echo '
</p>';
Title: Re: Einige Frage zu TP 2.1.x
Post by: AmaSha on February 10, 2022, 10:05:46 AM
Thanks @rjen.

As we had it in a block with TP 0.9.x it was very comfortable to have it that way again now.

Sorry for confusing - that was my fault.

Kind regards.

Thomas