| Author |
Message |
Milker
Nuke Soldier


Joined: Aug 20, 2003
Posts: 17
|
Posted:
Wed Aug 20, 2003 5:56 pm |
  |
Ok
First off Ive looked at all Raven's topics about Java to PHP with no result
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
Please please please help me im going nutz
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 |
_________________
 |
|
   |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Thu Aug 21, 2003 1:53 am |
  |
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 |
|
    |
 |
dezina
Support Mod


Joined: Jun 09, 2003
Posts: 1713
Location: England
|
Posted:
Thu Aug 21, 2003 3:33 am |
  |
Tested Raven's code, verified, works like a dream.. Thanks Raven  |
_________________
Backup files BEFORE altering
Use PHPNuke 7.6 with patches!!
No private messages please, POST in forums. |
|
    |
 |
Milker
Nuke Soldier


Joined: Aug 20, 2003
Posts: 17
|
Posted:
Thu Aug 21, 2003 7:26 am |
  |
WhoOT!!
I never doubted you Raven
It was the spaces after $content = <<<_JS_
Thanks soo much works like a charm.
www.murderersrow.net |
_________________
 |
|
   |
 |
Stevek
Nuke Soldier


Joined: Jul 04, 2003
Posts: 12
|
Posted:
Fri Aug 22, 2003 10:30 pm |
  |
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 |
|
|
   |
 |
dezina
Support Mod


Joined: Jun 09, 2003
Posts: 1713
Location: England
|
Posted:
Fri Aug 22, 2003 10:49 pm |
  |
| 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  |
_________________
Backup files BEFORE altering
Use PHPNuke 7.6 with patches!!
No private messages please, POST in forums. |
|
    |
 |
twelves
Lieutenant


Joined: Jul 13, 2003
Posts: 192
|
Posted:
Tue Aug 26, 2003 10:37 am |
  |
How? We need a working random block!
I just cant edit ANY code.
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>"; |
_________________
 |
|
    |
 |
5150Joker
Nuke Soldier


Joined: Sep 08, 2003
Posts: 22
|
Posted:
Sun Sep 07, 2003 9:22 pm |
  |
| 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! |
|
|
   |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Sun Sep 07, 2003 9:28 pm |
  |
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 |
|
    |
 |
bLaDe
Nuke Soldier


Joined: Jun 05, 2003
Posts: 15
|
Posted:
Tue Sep 16, 2003 1:57 am |
  |
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 |
|
|
   |
 |
dezina
Support Mod


Joined: Jun 09, 2003
Posts: 1713
Location: England
|
Posted:
Tue Sep 16, 2003 2:07 am |
  |
|
    |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Tue Sep 16, 2003 2:15 am |
  |
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 |
|
    |
 |
pure
Private


Joined: Jan 05, 2004
Posts: 41
|
Posted:
Wed Jan 07, 2004 7:04 pm |
  |
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
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. |
|
|
   |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Wed Jan 07, 2004 8:21 pm |
  |
|
    |
 |
BamBamPSK
Private


Joined: Nov 09, 2003
Posts: 46
|
Posted:
Thu Jan 08, 2004 3:31 pm |
  |
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 |
_________________
 |
|
     |
 |
|
|