TinyPortal

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

Previous topic - Next topic

vbgamer45

For my mods I do a function exists check to tell whether I am using SMF 2.0.x or SMF 2.1.x then load code based on that.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Sverige

hello guys, did't see the answers ive got, sorry about that!

you were right about the hiding of the version, and by stop hiding the version number it worked instantly!

so now i got alot of exploring to do tonight and check all the cool functions TP has to offer  :)

lurkalot

Quote from: Sverige on July 24, 2019, 05:37:52 PM
hello guys, did't see the answers ive got, sorry about that!

you were right about the hiding of the version, and by stop hiding the version number it worked instantly!

so now i got alot of exploring to do tonight and check all the cool functions TP has to offer  :)

Cool.  I can only apologise for not spotting the problem when you told me about the SMF version.  Glad you got it installed.  We live and learn.  ;)

Antechinus

Ok peeps, I found your buggy spans in 1.6.3. The problem is in Sources/TPassimilate.php, on Line 59.
*insert obvious Borg jokes here*

Code (Sources/TPassimilate.php) Select
// add upshrink buttons
if( ( strpos($forum_version, '2.1') !== false ) && array_key_exists('TPortal', $context) && !empty($context['TPortal']['upshrinkpanel']) ) {
$buffer = preg_replace('~<div class="navigate_section">\s*<ul>~', '<div class="navigate_section"><ul><span class="tp_upshrink21">'.$context['TPortal']['upshrinkpanel'].'</span>', $buffer, 1);
}


This fixes it:

Code (Sources/TPassimilate.php) Select
// add upshrink buttons
if( ( strpos($forum_version, '2.1') !== false ) && array_key_exists('TPortal', $context) && !empty($context['TPortal']['upshrinkpanel']) ) {
$buffer = preg_replace('~<div class="navigate_section">\s*<ul>~', '<div class="navigate_section"><ul><li class="tp_upshrink21">'.$context['TPortal']['upshrinkpanel'].'</li>', $buffer, 1);
}


And you need a small CSS tweak to go with it. This is on Line 1841:

Code (css/tp-style.css) Select
.tp_upshrink21, .navigate_section .tp_upshrink21 {
float: right;
margin-top:6px;
padding-left:10px;
}


Have tested it live on local. Seems to be fine. :)

And just so you know, the deprecated type="text/css" and type="text/javascript" calls for yesterday's 2.1 nightly, and for TP 1.6.3, are shown in the attached images. This is only part of the validation glitches. Will take a look at some of the rest later.

lurkalot

Thank you Antechinus, that's very helpful.   ;)  Hopefully we'll get some of this stuff sorted in the next release.

Antechinus

Here's a  couple more: for align, valign, border and frameborder.
TBH I don't know if (or which) browsers still give legacy support for these or not, but the HTML5 gods reckon they're kaput.

Note that there is one SMF 2.1 file listed (Subs-Editor.php) which is not your problem as such.

Since divs, etc naturally put text at the top anyway, my guess is that you could simply delete all instances of valign without noticing the difference. I think this is just a leftover from back when table cells for layout was a thing.

There seem to be quite a few instances of... style="width:15%;" align="center" ...which could be mass replaced with... style="width:15%; text-align:center" ...if you want to do it the easy way and leave the CSS files alone. Naturally this is evil, and will result in eternal damnation, but being good all the time is a PITA anyway. Personally I think just throwing in a class or two would make more sense, but it may be more frigging around.

Bloc

Those are from a different time lol :)

Probably TP should focus on using css classes for its widths etc. instead of relying on tables. Not to mention utilizing native CSS grids instead of home-brewn grids or *gasp* tables for layout/panels.

Major rewrite though, I would imagine. (I haven't been following so well what changes have been made in its templates past years)

@rjen

TinyPortal is not using tables anymore for some time now (I believe those were taken out in version 1.4R) but yes, a lot of the css stuff still dates from those days...  ;)

We already removed a lot of inline css in the last versions, but there still is a lot left to be done.
Good news is that it all still works fine in the current browsers and apart from the purists among us and the html5 validators no-one notices... 
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Bloc

Oh, I am not against that lol, just that the way it was implemented all those years ago - with precise placements of blocks and pixel-perfect widths etc. - is of less use today, since there are so many different resolutions that will always some way or the other, mess this up. :)

Thats why I've fallen in love with CSS grid styling lol, I mean whats not to love with a single CSS rule that puts all child containers - with gaps, you know, actual gaps that do not need special attention for first and last item and do not impact on widths/paddings/margins - in perfect thirds(of total width) without breaking a sweat? Not to mention it can place an unforeseen number of same width items on any width, make sure they never go below a set minimum width but otherwise expand to use all available space at any time? I wish this was possible when I wrote up all those layout options in TP wayback when. :)


@rjen

Quote from: Antechinus on July 24, 2019, 09:21:48 PM
And just so you know, the deprecated type="text/css" and type="text/javascript" calls for yesterday's 2.1 nightly, and for TP 1.6.3, are shown in the attached images. This is only part of the validation glitches. Will take a look at some of the rest later.

Hi Antechinus, I have done some cleanup on the TP code for HTML5 compliance. Thanks for the hints..

One issue comes to mind: TP 1.6.4 has a common codebase for 2.0 and 2.1. Validating the changes I find that the 2.0 branch has doctype : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" and 2.1 has doctype: <!DOCTYPE html>

As a result removing the types for the scripts actually causes errors in the validation on the 2.0.x installation with TP.

All scripts seem to work fine still on the old doctype even with removing the type. Is there a compelling reason not to do this yet?
If so we may have to included a version dependent access for all these occurrences, but I would rather not go through the trouble...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Antechinus

Fair point about the 2.0.x doctype, and I can't see the deprecated file types being a problem. They don't seem to break anything. If it's a drama to get rid of them I'd say just leave them for now. It'll give the Purple Peeps something to grumble about, and they like a good grumble. :)

gfa-skyranger

How to show x numbers of posts from a specified board on a block?


i want to show 4 topics on a two column-block from my info-board.

and under this i want to show recent topics of selected boards.

How can i do that?

[nofollow]

Kindred

you would have to build your own block using a php tinyportal block, then using SSI.php, call recentposts as an array

e.g. MyBlock=ssi_recentPosts(4,NULL,NULL,'array');

and then output the specific recentPosts information in the format that you want...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

lurkalot

Quote from: gfa-skyranger on August 04, 2019, 04:05:51 PM
How to show x numbers of posts from a specified board on a block?


i want to show 4 topics on a two column-block from my info-board.

and under this i want to show recent topics of selected boards.

How can i do that?

Quote from: Kindred on August 06, 2019, 03:17:45 AM
you would have to build your own block using a php tinyportal block, then using SSI.php, call recentposts as an array

e.g. MyBlock=ssi_recentPosts(4,NULL,NULL,'array');

and then output the specific recentPosts information in the format that you want...

I wasn't quite sure how this was supposed to look to be honest, is this to fill a whole page, or just fit in a block amongst other content on the page.  You could have posts showing from certain board as done for example here, https://www.smfhelper.com/index.php

A sketch, of the layout would be useful..   As would experimenting on a test site.

Kindred

for example, tweak the html output section as you see below



<?php
require_once('SSI.php');
$MyTopics=ssi_recentTopics(4,NULL,NULL,'array');
$MyPosts=ssi_recentPosts(4,NULL,NULL,'array');

echo '
<table border="0" class="ssi_table">'
;
foreach ($MyTopics as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
['
$post['board']['link'], ']
</td>
<td valign="top">
<a href="'
$post['href'], '">'$post['subject'], '</a>
'
$txt['by'], ' '$post['poster']['link'], '
'
, !$post['is_new'] ? '' '<a href="' $scripturl '?topic=' $post['topic'] . '.msg' $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' $settings['lang_images_url'] . '/new.gif" alt="' $txt['new'] . '" /></a>''
</td>
<td align="right" nowrap="nowrap">
'
$post['time'], '
</td>
</tr>'
;
echo '
</table>'
;


echo '
<table border="0" class="ssi_table">'
;
foreach ($MyPosts as $post)
echo '
<tr>
<td align="right" valign="top" nowrap="nowrap">
['
$post['board']['link'], ']
</td>
<td valign="top">
<a href="'
$post['href'], '">'$post['subject'], '</a>
'
$txt['by'], ' '$post['poster']['link'], '
'
$post['is_new'] ? '<a href="' $scripturl '?topic=' $post['topic'] . '.msg' $post['new_from'] . ';topicseen#new" rel="nofollow"><img src="' $settings['lang_images_url'] . '/new.gif" alt="' $txt['new'] . '" /></a>' '''
</td>
<td align="right" nowrap="nowrap">
'
$post['time'], '
</td>
</tr>'
;
echo '
</table>'
;



?>



Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

gfa-skyranger

Thank you for the answers.

They'll certainly help me out, I copied and pasted the example, and it works.

Unfortunately, it shows me ALL boards, but I only want to display one board, I have a bit of experimenting with the example, but without an explanation it is quite difficult.
(Got it, how it works... thx)

Anyway, I'll try to do that with Tinyportal.

If I fail then, I better try my time work in Portamx to stick,
there is already completely available, what your heart desires.

Unfortunately, this no longer works with the new php and mysql versions.
If I can make this work, I would certainly be happier.


But I think it makes more sense to fix something that was perfect than to mend something that is not really out of its own.


Well, thanks again, i will try to do my best with tinyportal for now.
[nofollow]

Kindred

to include only one board, change the first NULL in the call to the BoardID (e.g. 12)

to include multiple boards ass a line right after require_once $incl_board= array(12,14,15);
then  change the NULL to $incl_boards

the same can be done with the second NULL to exclude specific boards.


Side note: the SSI functions all respect the existing permissions...   so, as an admin, you can see everything, but normal users will not see info from a board which they can not actually access
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Working on a forum running TP 1.6.3 in 2.0.15, just did clean install and owner installed/configed TP.  Main menu is a bit wonky, TinyPortal menu button is visible to guests, shouldn't be (doesn't work), and there is no Forum button.  Don't see any settings for these.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

@rjen

TinyPortal button is visible to users that have permissions for the download manager (sub-menu button to TPdownloads should be functional): if you do not want users to see the menu option and the sub-menu to Tpdownloads, don't give them permissions for the download manager and the button will not show...

Not sure why there would not be a forum button: it should be there... link to the forum?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: