Hi All,
After quite some time I have eventually got TinyPortal to a stage where I can start to port it across to Elkarte relatively easily. It is available here; https://github.com/Tinyportal/ElkTP although I have currently tagged it as 1.0.0 please assume it is in Alpha stages and needs a lot of testing.
I have removed the Shoutbox, Menu and Downloads from it currently and will add them back in when I have got the existing code ported across in a nicer manor than I have currently. There isn't a controller as such it just hooks into the existing logic used for SMF which is what I will focus on. Most of the SQL was moved to the TinyPortal namespace before I started this in TinyPortal 2.0.0 and that's where eventually all the SQL will reside with the controller and views calling the appropriate functions.
The CSS styling on the blocks is one thing which I know doesn't work correctly and if I'm honest is not my forté. So if anyone can help with that I would appreciate it.
The latest tagged release download is here; https://tinoest.co.uk/forum/index.php?page=ElkTinyPortal
tino
Congratulations on getting that to work, it must have been a labor of love !!!
TP is a very cool portal I had wanted to port as well but the way it was written at the time required a level of dedication that I could not supply, you really had to "live" with that code to effectively make changes.
I've downloaded it and when I'm done playing with 1.1.7 I'm going to give it a run :D
Great news. Congratulations!
Indeed congratz!
I think I tried once, but gave up halfway, I had more confidence (not that much for the matter) with SP.
Thanks.
I have moved things around a lot since my first post. So I would get the latest version from GitHub when you do try it as it's probably not going to be the same as yesterday let alone a week ago. O:-)
I have to admit - the way TP coding was before Brad(Ichbin) and later tino, took over, was..."dedicated". :D I guess I wanted to put so much functionality in and really having less-than-ideal knowledge of finer PHP coding - I just used what I knew and duplicated. And duplicated again, possibly tweaked lol.So no wonder the code had to be "lived" to change it.
Seriously though, I think its great TinyPortal lives on, both as SMF and now also Elkarte mod.
Just a note that you're in good company Bloc. God created the platypus first,...
(Link-6856) .a beaked, web-footed hairy mammal that lays eggs (arguably putting too much functionality in, also) and then began to refine things from there..
And likewise, if you live with one long enough you find the platypus is kinda cool..
I just tested this add-on on Elkarte 1.1.7 and after I click on "Promote to frontpage" I get an error:
Tipo di errore: Generale
Warning: require_once(/sources/subs/Exception/Controller/TinyPortal/ElkException.class.php): failed to open stream: No such file or directory
/index.php?action=tportal;sa=publish;t=4
File: /sources/Autoloader.class.php
Line: 223
Thanks, looks like I need to escape the exception class. I’ll fix that in RC3, although that’s hiding another error.
Found another one, when you click to "show latest comments" index.php?action=tparticle;sa=showcomments
Tipo di errore: Database
Errore del Database: Unknown column 'var.type' in 'where clause'
/index.php?action=tparticle;sa=showcomments
File: /TinyPortal/Model/Database.php
Line: 43
Thanks, I have fixed the first one.
It's in this commit, which is mixed with other changes I'm afraid.
https://github.com/tinoest/ElkTinyPortal/commit/361e08bcc45bba028a6a1f5191e63628135ed2ae
The bit you need is https://github.com/tinoest/ElkTinyPortal/blob/361e08bcc45bba028a6a1f5191e63628135ed2ae/TinyPortal/Controller/Portal.php#L80
How do you get to the showcomments link? I never actually found out where that was defined.
Edit:
That was fixed on the main TinyPortal in this commit, https://github.com/Tinyportal/TinyPortal/commit/a8519b8a8303af4e5a48c4e5e683e4b2e14b5392#diff-e527f1a1f68898c41b31e4c2aae658183c74f4979192b96c45599c9ceaf980c9 I either need to port it across or if it's not actually referenced remove it. (As I don't know where it's referenced I'm relying on you for that one I am afraid)
That's also fixed in this PR and will be part of the RC3 release.
https://github.com/tinoest/ElkTinyPortal/commit/69d9e2382d8bfc9db4467da3147a31fc866d6de0
Thanks for the feedback and testing.
Killed a little time in home office. :D
German formal language pack for TinyPortal for ElkArte V1.0.0 RC3. Installable via package manager.
Hi,
I just downloaded and installed TinyPortal from github.
I get an error :
Exception: Call to undefined method TinyPortal\Model\Admin::updateSettingData()
https://augras.eu/elkatest/index.php?action=admin;area=tpsettings;sa=updatesettings
Fichier: /home/augras/public_html/augras.eu/elkatest/TinyPortal/Controller/PortalAdmin.php
Ligne: 148
It's in TinyPoratl setting, Select non responsive themes, pickElkArte Default Theme and click Save.
Philippe
That function should be updateSettings, I’ll get that changed when I can.
If you wanted to use TinyPortal on Elkarte 2.0 there is this branch which should largely work...
https://github.com/Tinyportal/ElkTP/tree/master
The old version which works on Elkarte 1.1. is here
https://github.com/Tinyportal/ElkTP/tree/Elkarte_1.1.0
In both instances they are an RC Release, due to the changes between Elkarte 1.1 and Elkarte 2.0 a new version is needed as the namespace is completely changed between the two.
edit: fixed URL's
Awesome!
How difficult was the change over? I've not done any 1.1->2.0 addon updates as of yet so I'm pretty curious as to how much broke.
To be honest fewer than I’d expected however TinyPortal isn’t written like any other Mod on here in that I’d moved it pretty much entirely to it’s own namespace. So I just needed to reference \Elkarte\Util rather than just Util. etc
The only issue I really had was integrate_front_page no longer seems to be called.
@Spuds This should show the changes; https://github.com/Tinyportal/ElkTP/compare/development...tinoest:TinyPortal_Elkarte2 some are formatting related, but relatively few in the grand scheme of things.
Very cool ... thanks for sharing those changes, its good to see what is required.
I do have the frontpage issue on my list. I'm kind of hoping it get magically fixed by one of my other many fixes :smile:
Updated version of german formal translation. :)
Does anyone else here have problems with PHP blocks? For me, the code editing field is not displayed and also the code from the existing templates is not taken over.
For the PHP articles and also for SMF2.0.19 with TinyPortal2.2 everything runs smoothly.
I found out finally that the development branch on github is ELK2.0 ... ::) ... thanx
@tino After the successful installation on my test system, TP was installed as a package: white page and the error log in the database tells me that several language files are not found ('Index.' , 'Addons.' , 'TPortal.') .
EDIT 1. After new installation (only ELK2)
Also interesting. I have to save the language manually in the settings as default for all after the installation.
EDIT 2. After installation of TP
White page remains. Even the error with missing language file (Unable to load the 'TPortal.English.php' language file.)
PS It's the system in the signature. Change ElkArte_TP to ElkArte2_TP.
There were some updates, really a rewrite, of how language files are loaded and where they are saved. I feel
@emanuele made these changes after
@tino did his updates for 2.0.
Languages used to be under [themes/languages/name/areas.php] so all areas of that language were lumped into a single directory. Example (/themes/languages/german/addons.german.php, and /themes/languages/german/index.german.php)
Now they are in the sources under ElkArte/Languages/Area/Xyz For example it would be /ElkArte/Languages/Addons/German.php and /ElkArte/Languages/Index/German.php (and all other installed languages there as well so /ElkArte/Languages/Index/English.php ... Addons can create their own Area directories so there could be a ElkArte/Languages/TP/Xyx.php
I guess the point being language is not a theme, but a site item. I have not done much with the new functions myself (yet) so can't really provide any specifics on how to best implement addons.
If emanuele can tear away from pornhub :see_no_evil: for a bit :laughing: , he can explain better.
I just need to change the TinyPortal load language function to accommodate that then, I’ve moved languages out into a TinyPortal namespace anyway so it’ll just be how I’m referencing the old stuff that’s causing the issue.
I’ll update the latest GitHub branch and get it all working again!
@Spuds I would try and update TinyPortal but it seems the installer is broken I get the following
[Mon Mar 21 20:09:04.093197 2022] [php7:error] [pid 2120] [client 192.168.0.15:50612] PHP Fatal error: Uncaught Error: Call to undefined function ElkArte\\detectServer() in /var/www/html/Elkarte2/sources/ElkArte/HttpReq.php:115\nStack trace:\n#0 /var/www/html/Elkarte2/sources/ElkArte/HttpReq.php(515): ElkArte\\HttpReq->__construct()\n#1 /var/www/html/Elkarte2/sources/ElkArte/AbstractModel.php(49): ElkArte\\HttpReq::instance()\n#2 /var/www/html/Elkarte2/sources/ElkArte/Errors/Errors.php(60): ElkArte\\AbstractModel->__construct()\n#3 /var/www/html/Elkarte2/sources/ElkArte/Errors/Errors.php(72): ElkArte\\Errors\\Errors->__construct()\n#4 /var/www/html/Elkarte2/sources/ElkArte/Database/Postgresql/Query.php(240): ElkArte\\Errors\\Errors::instance()\n#5 /var/www/html/Elkarte2/sources/ElkArte/Database/AbstractQuery.php(660): ElkArte\\Database\\Postgresql\\Query->error()\n#6 /var/www/html/Elkarte2/install/DatabaseCode.php(44): ElkArte\\Database\\AbstractQuery->query()\n#7 /var/www/html/Elkarte2/install/install_2-0_postgresql.php(190): DbWrapper->__call()\n#8 /var/www/html/Elkarte2/install/install.php(368): InstallInstructions_install_2_0_po in /var/www/html/Elkarte2/sources/ElkArte/HttpReq.php on line 115, referer: http://192.168.0.70/Elkarte2/install/install.php?step=3
I think I may have recently fixed that on my local. I need to put together a fix PR since I have a few now.
ETA: Nope that was a different issue, so this one is new. Will either have to add a stub in the install or ...
Ok got it working on MySQL... the error isn't actually an error as such. I just need to change some logic around as
@emanuele has changed what is classed as an error and what isn't.
It's only on postgre, MySQL install's fine.
This should work on PHP 7.4 after this fix
https://github.com/tinoest/ElkTinyPortal/commit/4084d87005f005514cde30c6694c109e873c739a
Not sure about other PHP version's, I need to sort the regression test for those.
Likely because I recently moved language files from themes/default/languages to sources/ElkArte/Languages and them a folder and a file with the language name.
This time around I don't think I have set up any sort of compatibility mode because it would have been to big of a pain in the plumbers crack to do...
Try changing the place of the files accordingly, in theory it should Just Works
TM.
Is there a way to edit the "About the author" below an article? I would like to add a brief bio, and not info about when I registered on the site, etc...
Only just seen this, you can edit the template or create your own custom one.
How do I uninstall TinyPortal?
Rick
Like any other addons.
Other add-ons have an uninstall feature this one does not
I beg to differ, as it installs and uninstalls the same as other addon’s.
Addon uninstall is made from admin > package manager page.
Looked there before didn't see it. Then I found it. Sorry gang, doctor won't let me drink coffee and it makes me look even dumber than I am.
Rick
Development version cannot be installed on PostgreSQL apparently and the version that can be downloaded from the addons seems to have some issue :(
After I install the one from the addons I get this:
(Link-10232) And index seems to get whole page stuffed into the left column. When clicking the TinyPortal settings it seems again duplicate the whole page in the place I suppose those settings should be. TP admin menu is showing on the left column though.
I am not sure if TinyPortal is properly maintained or whether it is suitable with development version. Have you tried the suggestion in reply #30 or tried it on 1.1.9 instead?
Ain't reply #30 about EA 2.0?
And no, I haven't tried on 1.1.9 ...
What comes to the development and maintaining I think
@tino is the one who can answer to that :)
Sorry I misread thus misunderstood. I thought you tried TP RC3 (the one in the link and in the guthub release) on EA development version which 2.0.
What version of php are you running? is_countable is a core function.
The left column thing is due to the error you raised.
I’ve not tried it on Postgre recently as I couldn’t get Elkarte 2.0 to install let alone TinyPortal.
I know it works in Postgre in 1.1.8 as that’s what I run it under. I need to fix the security issue warning for 1.1.9 (which is actually a patch I put in 1.1.9 so my own fault it’s broken)
Unfortunately not for me :(
I installed the one that is available from the EA addons, download didn't work from the package manager in EA, but I downloaded the .zip and then uploaded.
But the development version didn't have install button when I uploaded it ... so I don't know why gives.
Development won't on Elkarte 1.1.8 as it's for Elkarte 2.0.0 only. The master is also towards that now. The last tag should work on 1.1.8.
What version of PHP were you running? is_countable was introduced in PHP 7.3 and I would expect most places to be on that by now.
Oh ... then I've got misinformation about this matter from:
Followed that hyperlink which said to work with 1.1.x
OK ... that explains it then, since the server is way behind the updates for reasons I don't even want to know and I don't run the box, it's in much more knowledgeable hands of my friend, so I cannot do anything but relay this to him.
Server is in process to get some love and updates so when that happens things will work :)
if (!function_exists('is_countable')) {
function is_countable($var) {
return ( is_array($var) || $var instanceof Countable || $var instanceof \SimpleXMLElement || $var instanceof \ResourceBundle; );
}
}
Adding that to the bottom of TPortal.php should solve the undefined issue
That’s out of date now. I’ll sort the link to point to the Elkarte 1 branch later.
https://github.com/tinoest/ElkTinyPortal/tree/Elkarte_1.1.0
I'm not sure if blind or what, but I cannot find such file ... closest one I could locate is
ElkTinyPortal/TinyPortal/Views/TPortal.template.php
Nope you're not blind, I was thinking about TinyPortal for SMF.
https://github.com/tinoest/ElkTinyPortal/blob/abe7d8e4a0f64b63bbf54a593dfd67a6acafa733/TinyPortal/Integrate.php#L729
This line is where you want to add it. After the closing } and before the ?>
After adding that code I get
HTTP ERROR 500
And when I remove it "work" again. "Work" as in don't get the 500 :)
Error 500 is something is wrong.
It was added after the } and before the ?> ?
Should be happy as it’s outside the class scope. Only thing I can think of is it wasn’t in the right place or I’ve missed something obvious.
When I’m back on a pc I’ll upload the file with the change.
Bit delayed but attached is the file which should correct the error you are having. I haven't tested it on this version of PHP as it's been EOL for a long time. So there might be other errors.