You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 57 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Picture Of The Day [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Milker
Nuke Soldier
Nuke Soldier


Joined: Aug 20, 2003
Posts: 17


PostPosted: Wed Aug 20, 2003 5:56 pm Reply with quoteBack to top

Ok
First off Ive looked at all Raven's topics about Java to PHP with no result Sad
I want to make a block to show Pictures of the day. Then when u click on it it opens another webpage. Or just shows a block in the middle with fullsize picture. (dont really care how it works as long as it does)
I dont know PHP very well so if someone could help me I would greatly appreciate it.

I tried the Egallery and Coopermine or whatever lol but my Web host doest have the Magick files installed and they wont either Mad

Please please please help me im going nutz Exclamation
Here's the scipt I use in Java. Can this be converted to use in PHPNuke?
Code:
<script>
// This is it. Call this function from your page where you want the pic to appear.
function Pic_of_the_day(){
// Declare Local Variables
   var dateobj = new Date();
   var dayofthemonth;
   var thumbs = new Array(31);
   var pics = new Array(31);

// Image Thumbnails. usually 120x90 (case Matters!!)
thumbs[1]="ss/thumb1.jpg";
thumbs[2]="ss/thumb2.jpg";
thumbs[3]="ss/thumb3.jpg";
thumbs[4]="ss/thumb4.jpg";
thumbs[5]="ss/thumb5.jpg";
thumbs[6]="ss/thumb6.jpg";
thumbs[7]="ss/thumb7.jpg";
thumbs[8]="ss/thumb8.jpg";
thumbs[9]="ss/thumb9.jpg";
thumbs[10]="ss/thumb10.jpg";
thumbs[11]="ss/thumb11.jpg";
thumbs[12]="ss/thumb12.jpg";
thumbs[13]="ss/thumb13.jpg";
thumbs[14]="ss/thumb14.jpg";
thumbs[15]="ss/thumb15.jpg";
thumbs[16]="ss/thumb16.jpg";
thumbs[17]="ss/thumb17.jpg";
thumbs[18]="ss/thumb18.jpg";
thumbs[19]="ss/thumb19.jpg";
thumbs[20]="ss/thumb20.jpg";
thumbs[21]="ss/thumb21.jpg";
thumbs[22]="ss/thumb22.jpg";
thumbs[23]="ss/thumb23.jpg";
thumbs[24]="ss/thumb24.jpg";
thumbs[25]="ss/thumb25.jpg";
thumbs[26]="ss/thumb26.jpg";
thumbs[27]="ss/thumb27.jpg";
thumbs[28]="ss/thumb28.jpg";
thumbs[29]="ss/thumb29.jpg";
thumbs[30]="ss/thumb30.jpg";
thumbs[31]="ss/thumb31.jpg";

// Full sized ss (case matters!!)
pics[1]="ss/large1.jpg";
pics[2]="ss/large2.jpg";
pics[3]="ss/large3.jpg";
pics[4]="ss/large4.jpg";
pics[5]="ss/large5.jpg";
pics[6]="ss/large6.jpg";
pics[7]="ss/large7.jpg";
pics[8]="ss/large8.jpg";
pics[9]="ss/large9.jpg";
pics[10]="ss/large10.jpg";
pics[11]="ss/large11.jpg";
pics[12]="ss/large12.jpg";
pics[13]="ss/large13.jpg";
pics[14]="ss/large14.jpg";
pics[15]="ss/large15.jpg";
pics[16]="ss/large16.jpg";
pics[17]="ss/large17.jpg";
pics[18]="ss/large18.jpg";
pics[19]="ss/large19.jpg";
pics[20]="ss/large20.jpg";
pics[21]="ss/large21.jpg";
pics[22]="ss/large22.jpg";
pics[23]="ss/large23.jpg";
pics[24]="ss/large24.jpg";
pics[25]="ss/large25.jpg";
pics[26]="ss/large26.jpg";
pics[27]="ss/large27.jpg";
pics[28]="ss/large28.jpg";
pics[29]="ss/large29.jpg";
pics[30]="ss/large30.jpg";
pics[31]="ss/large31.jpg";

// get the date
dayofthemonth = dateobj.getDate();
// Do it!!
document.write('<a href="',pics[dayofthemonth],'" target="_blank"><img src="',thumbs[dayofthemonth],'" width="89" height="52" border="0"></a>');
}
// Done hiding -->
</script>

//then its executed here
<script>Pic_of_the_day();</script>


I just upload a thumbnail and a regular size picture to public_html/ss
Thanks in advance,
Milker

_________________
Image
Find all posts by MilkerView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Thu Aug 21, 2003 1:53 am Reply with quoteBack to top

I can promise you 100%, beyond a shadow of a doubt, if your script works stand alone, then if you wrap it in this code
Code:
<?
$content = <<<_JS_
// Your Script Here
_JS_;
?>
it will work. Make sure that you have no spaces after the _JS_ and _JS_; tags. Save the file in blocks/block-Your_Block.php. I have proven this over and over again. Just yesterday to Poncho.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
dezina
Support Mod
Support Mod


Joined: Jun 09, 2003
Posts: 1713

Location: England

PostPosted: Thu Aug 21, 2003 3:33 am Reply with quoteBack to top

Tested Raven's code, verified, works like a dream.. Thanks Raven Very Happy

_________________
Image
Backup files BEFORE altering
Use PHPNuke 7.6 with patches!!
No private messages please, POST in forums.
Find all posts by dezinaView user's profileSend private messageVisit poster's website
Milker
Nuke Soldier
Nuke Soldier


Joined: Aug 20, 2003
Posts: 17


PostPosted: Thu Aug 21, 2003 7:26 am Reply with quoteBack to top

WhoOT!!
I never doubted you Raven Cool

It was the spaces after $content = <<<_JS_
Thanks soo much works like a charm.

www.murderersrow.net

_________________
Image
Find all posts by MilkerView user's profileSend private message
Stevek
Nuke Soldier
Nuke Soldier


Joined: Jul 04, 2003
Posts: 12


PostPosted: Fri Aug 22, 2003 10:30 pm Reply with quoteBack to top

Ok Raven Here is one fo ya..
I am chasin a random picture block that will just randomly pic a image from a directory specified in the config file, is there such a block ???


Thanks

Steve
Find all posts by StevekView user's profileSend private message
dezina
Support Mod
Support Mod


Joined: Jun 09, 2003
Posts: 1713

Location: England

PostPosted: Fri Aug 22, 2003 10:49 pm Reply with quoteBack to top

Quote:
I am chasin a random picture block that will just randomly pic a image from a directory specified in the config file, is there such a block

Modify/adapt the amazon block to requirements Wink

_________________
Image
Backup files BEFORE altering
Use PHPNuke 7.6 with patches!!
No private messages please, POST in forums.
Find all posts by dezinaView user's profileSend private messageVisit poster's website
twelves
Lieutenant
Lieutenant


Joined: Jul 13, 2003
Posts: 192


PostPosted: Tue Aug 26, 2003 10:37 am Reply with quoteBack to top

How? We need a working random block!
I just cant edit ANY code. Sad

I want a guitar chord data base and random picture.
Any advice for me?

$content = "<br><center><a href=\"http://www.12string.net/albums/album02\" target=\"_blank\">";
$content .= "<img src=\"albums/album02/$image\" border=\"0\" alt=\"\"><br><br></center>";

_________________
Image
Find all posts by twelvesView user's profileSend private messageVisit poster's website
5150Joker
Nuke Soldier
Nuke Soldier


Joined: Sep 08, 2003
Posts: 22


PostPosted: Sun Sep 07, 2003 9:22 pm Reply with quoteBack to top

Raven wrote:
I can promise you 100%, beyond a shadow of a doubt, if your script works stand alone, then if you wrap it in this code
Code:
<?
$content = <<<_JS_
// Your Script Here
_JS_;
?>
it will work. Make sure that you have no spaces after the _JS_ and _JS_; tags. Save the file in blocks/block-Your_Block.php. I have proven this over and over again. Just yesterday to Poncho.



Just in case you don't see the PM:


Hi,

I read your message here about wrapping a working java script code with the _JS_ tags you mentioned and when I try this, I get the following error: Parse error: parse error in /home/clan786/public_html/blocks/block-ImageDay.php on line 2. I was wondering if you could help me get this thing working? Here is how the code looks the way I have it setup:

Code:


<?
$content = <<<_JS_<script>
// This is it. Call this function from your page where you want the pic to appear.
function Pic_of_the_day(){
// Declare Local Variables
   var dateobj = new Date();
   var dayofthemonth;
   var thumbs = new Array(31);
   var pics = new Array(31);

// Image Thumbnails. usually 120x90 (case Matters!!)
thumbs[1]="ss/thumb1.jpg";
thumbs[2]="ss/thumb2.jpg";
thumbs[3]="ss/thumb3.jpg";
thumbs[4]="ss/thumb4.jpg";
thumbs[5]="ss/thumb5.jpg";
thumbs[6]="ss/thumb6.jpg";
thumbs[7]="ss/thumb7.jpg";
thumbs[8]="ss/thumb8.jpg";
thumbs[9]="ss/thumb9.jpg";
thumbs[10]="ss/thumb10.jpg";
thumbs[11]="ss/thumb11.jpg";
thumbs[12]="ss/thumb12.jpg";
thumbs[13]="ss/thumb13.jpg";
thumbs[14]="ss/thumb14.jpg";
thumbs[15]="ss/thumb15.jpg";
thumbs[16]="ss/thumb16.jpg";
thumbs[17]="ss/thumb17.jpg";
thumbs[18]="ss/thumb18.jpg";
thumbs[19]="ss/thumb19.jpg";
thumbs[20]="ss/thumb20.jpg";
thumbs[21]="ss/thumb21.jpg";
thumbs[22]="ss/thumb22.jpg";
thumbs[23]="ss/thumb23.jpg";
thumbs[24]="ss/thumb24.jpg";
thumbs[25]="ss/thumb25.jpg";
thumbs[26]="ss/thumb26.jpg";
thumbs[27]="ss/thumb27.jpg";
thumbs[28]="ss/thumb28.jpg";
thumbs[29]="ss/thumb29.jpg";
thumbs[30]="ss/thumb30.jpg";
thumbs[31]="ss/thumb31.jpg";

// Full sized ss (case matters!!)
pics[1]="ss/large1.jpg";
pics[2]="ss/large2.jpg";
pics[3]="ss/large3.jpg";
pics[4]="ss/large4.jpg";
pics[5]="ss/large5.jpg";
pics[6]="ss/large6.jpg";
pics[7]="ss/large7.jpg";
pics[8]="ss/large8.jpg";
pics[9]="ss/large9.jpg";
pics[10]="ss/large10.jpg";
pics[11]="ss/large11.jpg";
pics[12]="ss/large12.jpg";
pics[13]="ss/large13.jpg";
pics[14]="ss/large14.jpg";
pics[15]="ss/large15.jpg";
pics[16]="ss/large16.jpg";
pics[17]="ss/large17.jpg";
pics[18]="ss/large18.jpg";
pics[19]="ss/large19.jpg";
pics[20]="ss/large20.jpg";
pics[21]="ss/large21.jpg";
pics[22]="ss/large22.jpg";
pics[23]="ss/large23.jpg";
pics[24]="ss/large24.jpg";
pics[25]="ss/large25.jpg";
pics[26]="ss/large26.jpg";
pics[27]="ss/large27.jpg";
pics[28]="ss/large28.jpg";
pics[29]="ss/large29.jpg";
pics[30]="ss/large30.jpg";
pics[31]="ss/large31.jpg";

// get the date
dayofthemonth = dateobj.getDate();
// Do it!!
document.write('<a href="',pics[dayofthemonth],'" target="_blank"><img src="',thumbs[dayofthemonth],'" width="89" height="52" border="0"></a>');
}
// Done hiding -->
</script>

//then its executed here
<script>Pic_of_the_day();</script>
_JS_;
?>



Thanks!
Find all posts by 5150JokerView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Sun Sep 07, 2003 9:28 pm Reply with quoteBack to top

As I said, you cannot have ANYTHING after the _JS_ tag and you have the script tag

Code:
$content = <<<_JS_<script>


Change it to
Code:

$content = <<<_JS_
<script>

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
bLaDe
Nuke Soldier
Nuke Soldier


Joined: Jun 05, 2003
Posts: 15


PostPosted: Tue Sep 16, 2003 1:57 am Reply with quoteBack to top

Hi Guys,
Raven I am not sure whether you'd be able to help me but I am struggling with trying to get Google's Adsense code on to my site.

Here is what I have gone from Google.

Code:

<script type="text/javascript"><!--
google_ad_client = "pub-2865511051681538";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


Now after reading the thread I have come up with the following code
Code:

<?
$content = <<<_JS_
<script>
<script type="text/javascript"><!--
google_ad_client = "pub-2865511051681538";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_color_border = "336699";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
_JS_;
?>


Not being a programmer or anything like that I am not really sure what I am doing wrong.

Thanks
Cheers
Darren
Find all posts by bLaDeView user's profileSend private message
dezina
Support Mod
Support Mod


Joined: Jun 09, 2003
Posts: 1713

Location: England

PostPosted: Tue Sep 16, 2003 2:07 am Reply with quoteBack to top

http://www.nukecops.com/postp50120.html#50120
bLaDe last post answered at above url Wink

_________________
Image
Backup files BEFORE altering
Use PHPNuke 7.6 with patches!!
No private messages please, POST in forums.
Find all posts by dezinaView user's profileSend private messageVisit poster's website
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Tue Sep 16, 2003 2:15 am Reply with quoteBack to top

bLaDe,

I have not tested your code, but assuming your code works outside of PHP, then that WHEREDOC syntax should work, ASSUMING, you definitely have nothing but a carriage return after the _JS_ and _JS_; tags. Also, this has to be in a block file, not the inline block from the administration page.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
pure
Private
Private


Joined: Jan 05, 2004
Posts: 41


PostPosted: Wed Jan 07, 2004 7:04 pm Reply with quoteBack to top

Thank you dezina for pointing me to this thread.

Raven I have been trying to use java script in my php but could not and it gave me lots a problem and you seems to be the one who can help. I would really appriciate if you could help me out too Very Happy

I created a menu using xara webstyle and after saving my menu I have 1 .html file and 2 .js files along with all the graphics. The html file has the following code and ofcourse the other 2 .js files are full of with java code.

Code:

<body bgcolor="#ffffff" text="BLACK">
<script src="xaramenu.js"></script><script Webstyle4 src="sidebar.js"></script>
</body></html>


What I am trying to understand here from your example is that if I should just create a file name block-SideMenu.php and copy all the java code from both of the .js files into this block-SideMenu.php file between the tags of _JS_ and _JS_; or do I just copy the code from .html file into my block-SideMenu.php file?

In any case do where do I need to store my .js files thats if I have to? Shold they be in /blocks folder or some where else?

I would really appriciate it plz help.

Thank you.
Find all posts by pureView user's profileSend private message
Raven
General
General


Joined: Mar 22, 2003
Posts: 5233

Location: USA

PostPosted: Wed Jan 07, 2004 8:21 pm Reply with quoteBack to top

I need to know a little more before responding. I have PM'd you.

_________________
Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff
Find all posts by RavenView user's profileSend private messageVisit poster's website
BamBamPSK
Private
Private


Joined: Nov 09, 2003
Posts: 46


PostPosted: Thu Jan 08, 2004 3:31 pm Reply with quoteBack to top

damn raven you are the man....i have some stuff i need help with but i would need a little more then what is here and a bit more extensive. ill go to your site and pm you or if you have aim you can cintact me that way

_________________
Image
Find all posts by BamBamPSKView user's profileSend private messageVisit poster's websiteAIM Address
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.353 Seconds - 339 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::