• [Mod] Random image / Zufallsbild 5 0 5 1
Currently:  

Author Topic: [Mod] Random image / Zufallsbild  (Read 868469 times)

0 Members and 3 Guests are viewing this topic.

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #465 on: November 23, 2007, 03:01:16 PM »
Quote
FYI
$image_name = $row['image_name'];
is on the 1st page from this MOD in random.txt file

Ok so use:

Code: [Select]
$image_name = format_text(trim($row['image_name']), 2);

Please see includes/functions.php (show_image function of Jan)

I'm a bit confused now  :roll: :roll: :roll:

Can anybody explain to me how I have to do the changes.
I have the original "random.php" from Nicky and want to showup my thumbsnails like in my "thumbnail_bit.html".



Thanks youuuu!!!!

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #467 on: November 23, 2007, 03:30:57 PM »
did you try that
http://www.4homepages.de/forum/index.php?topic=1020.msg105488#msg105488

Okay, I guess it works!
But where I have to put the <SCRIPT-CODE>. It looks like this:
Code: [Select]
<script language="JavaScript">
<!--
blink(0.7);

function blink(speed)
{
if (speed) {
if (document.all)
setInterval("blink()", speed*1000)
return;
}
var blink = document.all.tags("BLINK")
for (var i=0; i<blink.length; i++)
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

// -->
</script>

<script language="JavaScript">
<!--

function SymError()
{
  return true;
}

window.onerror = SymError;

//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<SCRIPT TYPE="text/javascript">
<!--

Xoffset= 16; // modify these values to ...
Yoffset= 16; // change the popup position.

var old,skn,iex=(document.all),yyy=-1000;

var ns4=document.layers
var ns6=document.getElementById&&!document.all
var ie4=document.all

if (ns4)
skn=document.dek
else if (ns6)
skn=document.getElementById("dek").style
else if (ie4)
skn=document.all.dek.style
if(ns4)document.captureEvents(Event.MOUSEMOVE);
else{
skn.visibility="visible"
skn.display="none"
}
document.onmousemove=get_mouse;

function popup1(msg,bak){
var content="<TABLE WIDTH=70 BORDER=1 bordercolor=#000000 CELLPADDING=0 CELLSPACING=0><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>";
yyy=Yoffset;
if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"}
if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''}
if(ie4){document.all("dek").innerHTML=content;skn.display=''}
}

function get_mouse(e){
var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft;
skn.left=x+Xoffset;
var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;
skn.top=y+yyy;
}

function kill(){
yyy=-1000;
if(ns4){skn.visibility="hidden";}
else if (ns6||ie4)
skn.display="none"
}

//-->
</SCRIPT>

Or can I just do "<? include("http://www.domain.com/random.php") ?>" ??

At the moment my <SCRIPT-CODE> is in my "header.html".
...or has it do be in the "random.php" ??


Thanks
« Last Edit: November 23, 2007, 03:41:31 PM by FunnyUser »

Offline djith

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #468 on: December 17, 2007, 07:03:16 PM »
someone an idea how to NOT include a certain category in the random pictures ?

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #469 on: December 17, 2007, 07:38:58 PM »
put this into both queries

example
Code: [Select]
AND a.cat_id NOT IN (4, 9, 15)

4,9,15 are only example, change it with your cat_id 's
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline djith

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #470 on: December 17, 2007, 09:32:17 PM »
Thank you for fast reply. I'm using 1.7.1 the original version and there is no such as random.php among the files... maybe in sessions??

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #471 on: December 18, 2007, 08:09:07 AM »
hmm...

are you writing about the random pics MOD or general about 4images random?
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline djith

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #472 on: December 18, 2007, 10:49:20 AM »
{random_image} was standard with the template... don't think it was a MOD.
There was a topic about it long time ago but can't find it ... was 3 years ago i think.
 

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #473 on: December 18, 2007, 11:07:25 AM »
;)

in this thread we talking about the MOD for external site
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline djith

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #474 on: December 18, 2007, 11:11:21 AM »
kk... will look further on the forum to find the topic :)

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [Mod] Random image / Zufallsbild
« Reply #475 on: December 27, 2007, 02:57:38 PM »
HI
hat super geklappt und bin happy damit
Gut gefallen würde es mir noch, wenn die bilder per javascript von rechts nach link oder umgekehrt langsam wandern würden.

hat jemand eine idee?
lg
glitzer

skiemor

  • Guest
Re: [Mod] Random image / Zufallsbild
« Reply #476 on: December 28, 2007, 09:43:57 AM »
put this into both queries

example
Code: [Select]
AND a.cat_id NOT IN (4, 9, 15)

4,9,15 are only example, change it with your cat_id 's

Hi Nicky, where and how exactly I have to code this to exclude categories. Which file, which place?

And who to exlude categories internal? I won't to show media-thumbs in random.

Thanks Chris.
« Last Edit: December 28, 2007, 09:57:57 AM by skiemor »

Offline bigwave

  • Newbie
  • *
  • Posts: 35
  • stuck on the North Shore of Maui
    • View Profile
    • Maui Tropica
Re: [Mod] Random image / Zufallsbild
« Reply #477 on: December 30, 2007, 04:09:40 AM »
This is what I need I think. I'd like to put a random thumbnail of my 1.74 gallery into my wordpress 2.31 blog in the new k2 template sidebar.  I have random.php working

http://www.maui-tropica.com/maui-tropica-gallery/random.php

but when I insert:

<?php
 include("http://www.maui-tropica.com/maui-tropica-gallery/random.php");
?>

into the sidebar I get these errors:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2

Warning: include(http://www.maui-tropica.com/maui-tropica-gallery/random.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2

Warning: include() [function.include]: Failed opening 'http://www.maui-tropica.com/maui-tropica-gallery/random.php' for inclusion (include_path='.:/usr/lib/php') in /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/wp-content/themes/k2/app/modules/php.php(7) : eval()'d code on line 2

I'm very new at this.  Is there something I should change in php.php to get this mod functioning or is it just not happy?  This mod is obviously the result of lots of hard work--thanks for the effort!  Here is my php.php code I case sombody knows the fix for my situation:
Code: [Select]
<?php

function php_sidebar_module($args) {
extract($args);

echo($before_module $before_title $title $after_title);
eval(' ?>
' . sbm_get_option('code') . '<?php ');
echo($after_module);
}

function php_sidebar_module_control() {
if(isset($_POST['
php_module_code'])) {
sbm_update_option('
code', stripslashes($_POST['php_module_code']));
} ?>

<p>
<label for="php-module-code"><?php _e('Module\'s code:''k2_domain'); ?></label><br />
<textarea id="php-module-code" name="php_module_code" rows="6" cols="30"><?php echo(wp_specialchars(htmlspecialchars(sbm_get_option('code'), ENT_QUOTES), 1)); ?></textarea>
</p>
<?php
}

register_sidebar_module('Text, HTML and PHP''php_sidebar_module''sb-php');
register_sidebar_module_control('Text, HTML and PHP''php_sidebar_module_control');

?>


Thanks very much!
« Last Edit: December 30, 2007, 02:32:50 PM by Nicky »

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #478 on: December 30, 2007, 02:38:37 PM »
hi bigwave.

you are trying to include with a URL not with PATH = wrong.

this is PATH: /home/bigwave/public_html/hawaii-agriculture/hawaii-agriculture-blog/
this is URL: http://www.maui-tropica.com/maui-tropica-gallery/

if both domains are on same server try this to include into wordpress

example (i don't know your structure)
Code: [Select]
<?php
 
include("/home/bigwave/public_html/maui-tropica/maui-tropica-gallery/random.php");
?>

cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #479 on: December 30, 2007, 02:41:14 PM »
put this into both queries

example
Code: [Select]
AND a.cat_id NOT IN (4, 9, 15)

4,9,15 are only example, change it with your cat_id 's

Hi Nicky, where and how exactly I have to code this to exclude categories. Which file, which place?

And who to exlude categories internal? I won't to show media-thumbs in random.

Thanks Chris.

hi Chris,

under both
Code: [Select]
        AND b.auth_viewimage=".AUTH_ALL."

and offcourse in random.php ;)
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi