MyBB Community Forums

Full Version: Coppermine Gallery random image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I have one question. How add random image in sidebox? (one image)

I would like to have last added images under header and one random image in sidebox.

My forum: http://domowipupile.hekko.pl/
is cpmFetch installed on Coppermine and working correctly?

how is teh sidebox built? templates only or can it process PHP?

if templates only, you need to install the cpmFetch Mybb plugin (different than the cpmFetch I mentioned above) which you can get from the site in my sig and modify it to output what you want
Coppermine and cpmFetch is wroking corectly and i have last added images under header.

But now i need one random images from gallery in sidebox.

index
Sidebox:

<div class="index_sidebar left">
	<style>.sortable { list-style-type: none; margin: 0; padding: 0;}</style>
	<ul class="sortable" id="sidebar_boxes">
		<!-- ADD YOUR BOXES HERE -->
		
		<li class="ui-state-default" id="box1">
			<div class="sidebar_box">
				<div class="sidebar_box_header">
					<span class="left">Klikaj i pomagaj! To na prawdę nic nie kosztuje!</span> 
					<button class="sidebox_close right"></button>
				</div>
			<div class="sidebar_box_content">
			<center><A HREF="http://www.pustamiska.pl" data-cke-saved-HREF="http://www.pustamiska.pl" TITLE="PustaMiska - akcja charytatywna"><img src=http://www.pustamiska.pl/images/banner3.png data-cke-saved-src=http://www.pustamiska.pl/images/banner3.png border=0 alt="PustaMiska - akcja charytatywna"></a>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="" width="210" height="210">
<PARAM NAME="movie" VALUE="http://www.karmimypsiaki.pl/banery/Karmimypsiaki_300x250_01.swf">
<param name="wmode" value="transparent" />
<param name="flashvars" value="nazwa=DomowiPupile.pl" />
<EMBED  FlashVars="nazwa=DomowiPupile.pl" play="false" wmode="transparent" swliveconnect="true"  src="http://www.karmimypsiaki.pl/banery/Karmimypsiaki_300x250_01.swf"  quality="high" bgcolor="#FFFFFF"  width="210" height="210" TYPE="application/x-shockwave-flash"></EMBED>
</OBJECT>



</center>
			</div>
		</li>

		<li class="ui-state-default" id="box2">
			<div class="sidebar_box">
				<div class="sidebar_box_header">
					<span class="left">Losowe Zdjęcie</span> 
					<button class="sidebox_close right"></button>
				</div>
				<div class="sidebar_box_content">
				

				</div>
			</div>
		</li>
			
		<li class="ui-state-default" id="box3">
			<div class="sidebar_box">
				<div class="sidebar_box_header">
					<span class="left">Sidebox title</span> 
					<button class="sidebox_close right"></button>
				</div>
				<div class="sidebar_box_content">
				Ae punk! ya i'm talking to you. Now you drag my ass all the way to the bottom or i'm gonna kick you ass.
				</div>
			</div>
		</li>

<li class="ui-state-default" id="box4">
			<div class="sidebar_box">
				<div class="sidebar_box_header">
					<span class="left">Sidebox title</span> 
					<button class="sidebox_close right"></button>
				</div>
				<div class="sidebar_box_content">
				I'm the second box and i really love the header animation. Would you drag me to first position? i've never been there
				</div>
			</div>
		</li>

<li class="ui-state-default" id="box5">
			<div class="sidebar_box">
				<div class="sidebar_box_header">
					<span class="left">Reklama</span> 
					<button class="sidebox_close right"></button>
				</div>
				<div class="sidebar_box_content">
				Wkrótce!
				</div>
			</div>
		</li>

	</ul>
</div>

and?
if you are using my cpmFetch plugin, change

$plugins->add_hook('portal_start', 'add_random', 1000000);

to

$plugins->add_hook('index_start', 'add_random', 1000000);

and then find

    $objCpm->cpm_viewRandomMediaFrom('album=4', 1, 1, $options);

and change "ablum=4" to whatever album ID you want to pull a single image from.
I Add your cpmFetch and now xD i don't have last added images under header xD
what were you using prior?
prior?
how did you get the last added images before adding my plugin?
I added photo now and nothing