Hi sir
i want to show Random Pic on my home page plz gide me
thx
Regard
Ahsan Ch (PAK)
Not related to install - moving.
If you mean a non-coppermine-driven page where you want to disply content taken from coppermine, then take a look at the mod board "content syndication". The coppermine dev team recommends using cpmFetch.
hi sir Good morning
sir i can not understand what you say sir plz tell me in detail i m very thanks ful to you.
thx
Regard
Ahsan CH (PAK)
Link to the sub-board "content syndication": http://forum.coppermine-gallery.net/index.php?board=57.0
Link to the announcement thread for cpmFetch: http://forum.coppermine-gallery.net/index.php?topic=35231.0
If this is a language issue, ask a friend to translate this for you.
hi...
use CPMFetch download if from http://cpmfetch.fistfullofcode.com/ and just upload it to your gellery folder use
http://yourdomain.com/path_to_gallery/install.php
to install and use
<?php
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewRandomAddedMediaFrom(1,4);
$objCpm->cpm_close();
?>
code
Thanks
Nish
That set of instructions is too simple. I posted the links to the relevant thread / board. ahsanch needs to read up the docs.
Very cool feature, with a little trial and error I managed to get it working easily and that's saying something for me!
Hi. Someone showed me how to do this without using any add-ons. I am currently using it in the 'welcome' section at the top of my gallery page: http://www.oneuk.f2s.com/photos/
Here is the code: (Let's say for this example you are using a file called 'anycontent2.php') (sorry if it's a bit long winded!)
1. Create a folder anywhere on your webserver where you will put your random images, and upload the images you want to use
2. Make a copy of the file 'anycontent.php' and rename it to anycontent2.php
3. Add the following code to this file:
<?php
$banners = array(1 => 'rand1.jpg', 2 => 'rand2.jpg', 3 => 'rand3.jpg', 4 => 'rand4.jpg');
$random = rand(1,4);
$banner = "http://www.oneuk.f2s.com/images/rand/" . $banners[$random];
echo "<p style='text-align: left'><img border=6 src='" . $banner . "' alt='' /></p>";
?>
Below is a description of the code:
<?php
$banners = array(1 => 'rand1.jpg', 2 => 'rand2.jpg', 3 => 'rand3.jpg', 4 => 'rand4.jpg'); // this is a list all of the image numbers that you will be using and their filenames
$random = rand(1,4); // this is which of the above image numbers you want to use (in this case all of them) so if you have 4 images as I have here you use "(1,4)" if you have 5 images use "(1,5)" for 10 use "(1,10)" etc etc
$banner = "http://www.oneuk.f2s.com/images/rand/" . $banners[$random]; // this is the folder where your images are located. Change for your server details obviously.
echo "<p style='text-align: left'><img border=6 src='" . $banner . "' alt='' /></p>";
?>
Now open 'index.php' and find the following code:
case 'anycontent':
if ($cat == 0) {
ob_start();
/**
* Any php code or HTML can be put in this file and will be displayed
*/
include('anycontent.php');
$anycontent = CPGPluginAPI::filter('anycontent',ob_get_contents());
ob_end_clean();
echo ($anycontent);
}
flush();
break;
and add below it: (basically change all instances of 'anycontent')
case 'anycontent2':
if ($cat == 0) {
ob_start();
/**
* Any php code or HTML can be put in this file and will be displayed
*/
include('anycontent2.php');
$anycontent2 = CPGPluginAPI::filter('anycontent2',ob_get_contents());
ob_end_clean();
echo ($anycontent2);
}
flush();
break;
That's it, it works for me!
See my gallery: http://www.oneuk.f2s.com/photos/
Refresh the page and the images at the top left of the page will change
that's not a bad idea either, but i don't want to re-upload all 7000 images i have in my gallery into another folder
good for those who want a small bit of random images though!