MyBB Hacks

Full Version: Music Gallery
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
(11-25-2010 01:03 PM)leefish Wrote: [ -> ]There is a random thread plugin on MYBB mods. maybe you can use that?

i just download the plugin, and the code is very easy, but must modified a little bit.
the plugin add only a link in welcomeblock, and add a function in misc.php

plugin.php:

PHP Code:
function randomthread_activate()
{
require "../inc/adminfunctions_templates.php";
find_replace_templatesets("header_welcomeblock_member", "#".preg_quote('{$lang->welcome_todaysposts}</a>')."#i",'{$lang->welcome_todaysposts}</a> | <a href="misc.php?action=random">Random Thread</a>');
}

function randomthread_deactivate()
{
find_replace_templatesets("header_welcomeblock_member", "#".preg_quote('| <a href="misc.php?action=random">Random Thread')."#i",'');
}


changed misc.php:

PHP Code:
function random_thread()
{
global $db;
$rand_thread = "SELECT tid FROM ".TABLE_PREFIX."threads ORDER BY RAND() LIMIT 1;";
echo mysql_error();
$random_thread_q = $db->query($rand_thread);
$random_thread = $db->fetch_array( $random_thread_q );
echo "<meta HTTP-EQUIV='REFRESH' content='0; url=showthread.php?tid=".$random_thread['tid']."'>";
}

if($mybb->input['action'] == "random")
{
random_thread();
}


now i need a changed code, that i have only results from 1 forum (music-gallery),
and not from all forums.
need help by this Tongue

This seems to work. It would be more elegant if it was specified from the settings

PHP Code:
function random_thread()
{
global $db;
$rand_thread = "SELECT tid FROM ".TABLE_PREFIX."threads WHERE fid='7' ORDER BY RAND() LIMIT 1;";
echo mysql_error();
$random_thread_q = $db->query($rand_thread);
$random_thread = $db->fetch_array( $random_thread_q );
echo "<meta HTTP-EQUIV='REFRESH' content='0; url=showthread.php?tid=".$random_thread['tid']."'>";
}

work perfect Yes

leefish Wrote:It would be more elegant if it was specified from the settings

yes, i think so too. the plugin is very simple and would be better to select the forums
for rondom threads. but now for me it´s ok for random music threads.

thx leefish Wink
The plugin might not be so good if you have more threads (order by rand() is somewhat slow).

Dunno if this still works, but you could use it as a base: http://mybbhacks.zingaburga.com/showthread.php?tid=28
Update (need at least XThreads 1.47):

1. msc_forumdisplay_thread template:
Find (around line #9):

HTML Code
<img src="{$GLOBALS['threadfields']['mscpic']['url']}/thumb160x120" alt="" title="" />


Replace with:

HTML Code
<img src="{$GLOBALS['threadfields']['mscpic']['thumbs']['160x120']['url']}" alt="" title="" />


2. msc_postbit_first template.
Find (around line #38):

HTML Code
<img src="{$GLOBALS['threadfields']['mscpic']['url']}/thumb160x120" alt="" title="" />


Replace with:

HTML Code
<img src="{$GLOBALS['threadfields']['mscpic']['thumbs']['160x120']['url']}" alt="" title="" />


Find (around line #126):

HTML Code
<img src="{$GLOBALS['threadfields']['mscpic']['url']}/thumb280x210" alt="" title="" />


Replace with:

HTML Code
<img src="{$GLOBALS['threadfields']['mscpic']['thumbs']['280x210']['url']}" alt="" title="" />

(08-23-2010 02:09 AM)RateU Wrote: [ -> ][...]Here is a simple example (based on MyBB 1.4):[...]
Is this Plugin for MyBB 1.6 too?
Why not just test it?
Update:
Use Settings Overrides for the Force Postbit Layout settings in create/edit forum settings:
  • Settings Overrides:
    • Setting: Showthread Options -> Post Layout
      Value: horizontal

      Code:
      postlayout=horizontal

It's not work for me. Even I upload .mp3 file into my forum and give the link to music url, it still doesn't works Frown

Anyone can help? If possible, please give me the 1pixelout audio player compatiable with this xthread application. I'm using the audio player lastest and I think it's the reason it doesn't works.
Tr changing the player id, for example:

HTML Code
<tr>
<td class="tcat">
<script language="JavaScript" src="{$mybb->settings['bburl']}/player/audio-player.js"></script>
<object type="application/x-shockwave-flash" data="{$mybb->settings['bburl']}/player/player.swf" id="ap_{$thread['tid']}" height="24" width="290">
<param name="movie" value="{$mybb->settings['bburl']}/player/player.swf">
<param name="FlashVars" value="playerID=ap_{$thread['tid']}&amp;soundFile={VALUE}">
<param name="quality" value="best">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
</td>
</tr>

Pages: 1 2 3 4
Reference URL's