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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 423
  • Total: 423

[Discussion] Tabbed Block by Mouse Over

Started by Freddy, September 05, 2009, 05:31:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dimdom

freddy888, hi once again.

This is the code for a php block that grabs new downloads from the Download system mod from http://www.smfhacks.com/

(Found it in a thread in Block code snippets).

It would be a good idea to add this too, as an alternative to TP Downloads.

global $db_prefix, $scripturl;
$cats = array();
$cat = implode(',',$cats);
$categories = '';
if(!empty($cats))
$categories = "AND f.ID_CAT IN($cat)";
$request = db_query("SELECT f.ID_FILE, f.ID_MEMBER, f.date, f.ID_CAT, f.title AS ftitle, f.totaldownloads,
c.title, m.realName, m.ID_MEMBER AS mID_MEMBER
FROM {$db_prefix}down_file AS f, {$db_prefix}down_cat AS c, {$db_prefix}members AS m
WHERE f.ID_CAT = c.ID_CAT
AND f.approved = '1'
AND f.ID_MEMBER = m.ID_MEMBER
$categories
ORDER BY f.ID_FILE DESC
LIMIT 5",__FILE__,__LINE__);
while($row = mysql_fetch_assoc($request)) {
echo '<table width="100%" cellpadding="2" cellspacing="0">
<tr>
<td valign="top" class="smalltext"> <a href="',$scripturl,'?action=downloads;sa=view;id=',$row['ID_FILE'],'">',$row['ftitle'],'</a></td>
<td valign="top" class="smalltext" align="right">',$row['totaldownloads'],'</td>
</tr>
</table>';
}


I have tried but I failed... It shows in every tab.

Have a good day. :)


ZarPrime

dimdom,

Even though the Download Manager from SMF Hacks has a lot of nice features, why would I use that if I had a perfectly good Download Manager which comes bundled with TinyPortal, especially since the code that freddy wrote is designed to be used with TinyPortal.

ZarPrime

dimdom

#32
Hi ZarPrime, first of all remember that I work with TP 0.9.8 and I will not update to the beta because it doenst give me the opportunity to test it with SMF2. I dont have must time free for updating now, the hard way since my sites are heavily modified, and after a while once again with the newer versions.


So my answer is: for these main reasons:

It has the search function

It has the comments function.

It has the mail notify function.

It has the auto genarated topic function for every file you add to it,

and most of all, because it is already SMF2 compatible, tested and working.  :)

ZarPrime

Ah, I see.  Well, though I don't know that all of these features will be in the Download Manager for TP 1.0 beta 5 in the beginning, that version will have some of these features, include the ability to work with SMF 2.0.

ZarPrime

Freddy

QuoteIt would be a good idea to add this too, as an alternative to TP Downloads.

Okay, I can have a look at that.  I am not familiar with that mod, so I will have to download it and figure it out.  May take me a while as I seem to have a lot of things going on at the moment.  If you don't hear from me for a while, feel free to jog my memory  ;)

cslactrn

Hello,
This is an awesome mod!  I have installed it and made some minor modifications according to your directions and it works perfectly.  I'd like to see if I can have a tab for Articles in just 1 category, not all.  I tried to set a category to the one I want, but I don't really know the code to use and it returns an error on that tab.

The commented line for configuration says:
//   $cats = categories to include [changed to use the passed GET variable from the TP block 888]

that line says:
  $cats = $categories,

So what should I change that to?  Say I want to include only category 10.

Hopefully this makes sense.  Thanks for any help!
- Cindi

cslactrn

Sorry, I am officially an idiot  :idiot2:

It does clearly state in the php file that you can select the category(s) you want to show in the block code.

I guess it's a case of RTFM!

Thanks for a wonderful mod!

-- Cindi

Freddy

Haha, yes I did that to make it simpler to change  ;D

Glad you figured it out and it works for you...

alhaudhie

how can i add html script? like
<iframe name="the_iframe" id="the_iframe" src="http://myforum.smf/index.php?action=shoutbox" allowtransparency="true" frameborder="0" scrolling="no" width="100%" height="195"></iframe> in the function?

Freddy

Go back and read my example here... it should give you the idea :

http://www.tinyportal.net/index.php?topic=30787.msg247669#msg247669

Obviously you will need to echo out the HTML in your new function.

This website is proudly hosted on Crocweb Cloud Website Hosting.