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

Recent

Welcome to TinyPortal. Please login or sign up.

April 30, 2024, 09:27:48 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,174
  • Total Topics: 21,220
  • Online today: 147
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 104
  • Total: 104

[hack] TP Downloads - Guests View Only Mod

Started by akulion, December 27, 2006, 03:54:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

G6Cad

They are the same, but it will have to be updated for the next release.

yosemite

I have applied the mod and enabled the guest permissions. I can now see the download block but when i click on it ti shows the file repository but no files. What am i doing wrong?

thanks

cf

vdubbia

wouldn't a better solution just to make the download link viewable to registered members?  doesn't that already exist?

not dissing this mod, just thought this was already an option...

IchBin

Nope, only access to the actual view of download sections has a permission. More to come as always. :)

than

#34
Hi,

I'm trying to make manual install in TP 1.0.5 beta 1. Editing Tpdlmanager.template, i found and change the first part of code:

In the mod:

<a href="'.$scripturl.'?action=tpmod;dl=get'.$item['id'].'"><img style="margin: 5px;" align="right" src="'.$settings['images_url'].'/TPdownloadfile.gif" alt="" /></a>';

In my file:
<a href="'.$scripturl.'?action=tpmod;dl=get'.$item['id'].'"><img style="margin: 5px;" align="right" src="' .$settings['images_url'].'/TPdownloadfile.gif" alt="" /></a>';

Only differs in space (="' .$settings)

The problem is in the second code modification. The mod code and my file code differs more than my knowledge in PHP.

In the mod:
if($context['TPortal']['dlaction']=='item')
echo '
<a href="'.$dlitem['href'].'"><img src="' . $settings['images_url']. '/TPdownloadfile.gif" border="0" align="right" alt="" /></a>';

echo '
<b><a href="'.$dlitem['href'].'">'. $dlitem['name'] .'</a></b> ' , ($context['TPortal']['dlaction']!='item' && isset($dlitem['filesize'])) ? '<br />'.$dlitem['filesize'] : '' ,  '<div class="smalltext">
'.$dlitem['description'];


In my file:
   if($context['TPortal']['dlaction']=='item'){

         // extra information like downloads, views etc.
         echo '
         <tr><td rowspan="2" class="windowbg2" align="center"><img src="' .$settings['tp_images_url']. '/TPinfo.gif" alt="" /></td>
             <td class="windowbg2"><a href="'.$dlitem['href'].'"><img src="' .$settings['tp_images_url']. '/TPdownloadfile.gif" alt="'.$txt['tp-download'].'" /></a>
             </td>
         </tr><tr>
             <td class="windowbg2"><span class="smalltext">
              '.$txt['tp-uploadedby'].': <a href="'.$scripturl.'?action=profile;u='.$dlitem['authorID'].'"><b>'.$dlitem['author'].'</b></a> (' , timeformat($dlitem['created']) , ')
                 </span>
             </td>
         </tr><tr>
<td align="center" valign="top" class="windowbg2" style="clear: both;" width="2%">
<img src="' .$settings['tp_images_url']. '/TPthumbup.gif" alt="" />
</td>
             <td class="windowbg2"><span class="smalltext">';

echo $txt['tp-ratingaverage'] . ' ' . ($context['TPortal']['showstars'] ? (str_repeat('<img src="' .$settings['tp_images_url']. '/TPblue.gif" style="width: .7em; height: .7em; margin-right: 2px;" alt="" />', $dlitem['rating_average'])) : $dlitem['rating_average']) . ' (' . $dlitem['rating_votes'] . ' ' . $txt['tp-ratingvotes'] . ')';

if($dlitem['can_rate']){
echo '<form style="margin-top: 1em;" name="tp_dlitem_rating" action="',$scripturl,'?action=tpmod;sa=rate_dlitem" method="post">
' , $txt['tp-ratedownload'] , ' <select size="1" name="tp_dlitem_rating">';
for($u=$context['TPortal']['maxstars'] ; $u>0 ; $u--){
echo '
<option value="'.$u.'">'.$u.'</option>';
}
echo '
</select>
<input type="submit" name="tp_dlitem_rating_submit" value="',$txt['tp_rate'],'">
<input name="tp_dlitem_type" type="hidden" value="dlitem_rating">
<input name="tp_dlitem_id" type="hidden" value="'.$dlitem['id'].'">
<input type="hidden" name="sc" value="', $context['session_id'], '" />
</form>
</div>';
}
else
echo '
<hr /><i>'.$txt['tp-dlhaverated'].'</i>';


echo '
</span>
             </td>
         </tr>';


Anyones have interest on make an adaptation for work with TP 1.0.5?? Or tell me what modifications i should make?

Really thanks, and sorry for my English.

G6Cad

Will probably need a complete rewrite.
The download and the download module are in the workd to be a standalone module for TP so the code will probably change a whole lot from the one you posted now.