TinyPortal

Development => Support => Topic started by: raid on March 08, 2011, 12:53:33 AM

Title: editing own uploaded item as user
Post by: raid on March 08, 2011, 12:53:33 AM
hi,

I cannot find reported issue about it.

I am using my localhost installation so smf 1.1.13 and tp 1.0 rc1, english language. all default, no mod installed.

I configured that all uploaded item must be approved by an admin, so a user with the upload rights but not admin one, can upload. then an admin approve it. so now the item is online, and the uploader (the user) is able to edit this item but editing the item no editor is loaded, bbc or html (actually I have bbc enabled, but I see in source that no editor is present on that speficic action)

am I wrong? is it a known bug/missing?
Title: Re: editing own uploaded item as user
Post by: IchBin on March 14, 2011, 09:33:24 PM
Looks like a bug IMO. I'll go ahead and add this to the bug tracker.
Title: Re: editing own uploaded item as user
Post by: raid on March 15, 2011, 10:09:14 PM
I fixed, I think, I post to share:

TPdlmanager.template.php
Code (Find) Select
<textarea  rows="40" cols="10" style="width: 90%;" name="dladmin_text'.$cat['id'].'" id="dladmin_text'.$cat['id'].'" wrap="on">'.$cat['description'].'</textarea>';

Code (Replace with) Select
';
if($context['TPortal']['dl_wysiwyg'] == 'html')
TPwysiwyg('dladmin_text'.$cat['id'], html_entity_decode($cat['description'],ENT_QUOTES), true,'qup_dladmin_text');
elseif($context['TPortal']['dl_wysiwyg'] == 'bbc')
TP_bbcbox('dl_useredit','dladmin_text'.$cat['id'], html_entity_decode($cat['description'],ENT_QUOTES));
else
echo '<textarea name="dladmin_text'.$cat['id'].'" style="width: 99%; height: 300px;">'. html_entity_decode($cat['description'],ENT_QUOTES).'</textarea>';


EDIT: on useredit the preview button isn't working, it's just the published page, not a preview
Title: Re: editing own uploaded item as user
Post by: IchBin on March 16, 2011, 09:46:00 PM
Thanks for posting that, I'll review this when I get a chance. In the middle of major changes for TP. Converting all the database queries to $smcFunc. :(