Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Music Gallery
Jumper Offline
Member
***
Posts: 75
Joined: Aug 2010
Post: #11
RE: Music Gallery
(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:
1
2
3
4
5
6
7
8
9
10
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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

11-26-2010 12:07 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #12
RE: Music Gallery
This seems to work. It would be more elegant if it was specified from the settings

PHP Code:
1
2
3
4
5
6
7
8
9
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']."'>";
}



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 11-26-2010 01:13 AM by leefish.)
11-26-2010 01:12 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Jumper Offline
Member
***
Posts: 75
Joined: Aug 2010
Post: #13
RE: Music Gallery
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
11-26-2010 02:54 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #14
RE: Music Gallery
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

My Blog
11-26-2010 07:33 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #15
RE: Music Gallery
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="" />


10-23-2011 06:10 AM
Find all posts by this user Quote this message in a reply
Lkwmonster Offline
Junior Member
**
Posts: 8
Joined: Jun 2012
Post: #16
RE: Music Gallery
(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?
06-16-2012 04:47 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #17
RE: Music Gallery
Why not just test it?

My Blog
06-16-2012 06:58 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #18
RE: Music Gallery
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


10-08-2012 02:41 AM
Find all posts by this user Quote this message in a reply
NNT_ Offline
Junior Member
**
Posts: 18
Joined: Feb 2011
Post: #19
RE: Music Gallery
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.
10-25-2012 01:32 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #20
RE: Music Gallery
Tr changing the player id, for example:

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
<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>


10-27-2012 01:59 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: