MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completelly customizable, expandable and suitable for all needs.
Moderators: Moderators
Forum RSS feedReply
javascript in blocks
AuthorText
ravi
Junior Member
Avatar

Posts: 17
Contributes: 2

Gender: _NEUTRAL_
Online: No
Date: 05/06/2008 03:19
javascript in blocks
#post7861
Hey Guys i want to implement this carousel feature in a block in my site. but it uses javascript and by the looks of it the blocks feature omits the javascript.

is there any way around this?

www.playboxed.org

you can see the image on the main page but its supposed to scroll through 2 more images.

Delete Edit Quote
 
JPappi
Senior Member
Avatar

Posts: 293
Contributes: 70

Gender: _MALE_
Online: No
Date: 05/06/2008 09:07
Re: javascript in blocks
#post7870
A very simple solution is using banners.
Create a new banner in adminpanel -> banners. There you can user js.
Create your new block and insert for example:

<?PHP showBanner(yourBannerposition); ?>

It should work for you
JPappi - have fun with memHT

Project at work: Find-4u.de

Image
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

Avatar

Posts: 4662
Contributes: 1969

Gender: _MALE_
Online: No
Date: 05/06/2008 09:54
Re: javascript in blocks
#post7874
LoL, i would suggest creating a block but your solution JPappi is unique Smile
Delete Edit Quote
 
ravi
Junior Member
Avatar

Posts: 17
Contributes: 2

Gender: _NEUTRAL_
Online: No
Date: 05/06/2008 11:20
Re: javascript in blocks
#post7880
quote
JPappi:
A very simple solution is using banners.
Create a new banner in adminpanel -> banners. There you can user js.
Create your new block and insert for example:

<?PHP showBanner(yourBannerposition); ?>

It should work for you


hello jpappi I cant figure out how to get it to pick up this code.

when i try this

<?php showBanner(bottom); ?>

It just doesnt recognize it in the block. bottom is the position i created and my banner is called ddd.
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

Avatar

Posts: 4662
Contributes: 1969

Gender: _MALE_
Online: No
Date: 05/06/2008 12:11
Re: javascript in blocks
#post7881
showBanner(BANNERPOSITION); where BANNERPOSITION is a number, related with the position created in admin > banenrs > positon.

Anyway, if you find this complicated, create a new file block and put there your js code

http://www.memht.com/documents_Creating+new+Blocks.html
Delete Edit Quote
 
JPappi
Senior Member
Avatar

Posts: 293
Contributes: 70

Gender: _MALE_
Online: No
Date: 05/06/2008 13:34
Re: javascript in blocks
#post7892
Hehe, i believe it a good suggestion, cause you can use it everywhere you want.
JPappi - have fun with memHT

Project at work: Find-4u.de

Image
Delete Edit Quote
 
ravi
Junior Member
Avatar

Posts: 17
Contributes: 2

Gender: _NEUTRAL_
Online: No
Date: 06/06/2008 02:07
Re: javascript in blocks
#post7950
Im so sorry Mem im still confused. I'll try to figure it out. my code for activating the banner is

<html>
<div id="slide1dv" style="position:relative;width:500px;height:300px;overflow:hidden;padding:0px;margin:0px;border-style:solid;border-width:0px;border-color:#FFFFFF;z-index:1;FILTER: progidSmileXImageTransform.Microsoft.Fade(Overlap=1.00,duration=1,enabled=false);"><img src="http://www.playboxed.org/viewer/ft1.jpg" width="500" height="300"></img></div>
<script src="http://www.playboxed.org/viewer/fader.js" type="text/javascript"></script>
</html>

how do i make a new file?
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

Avatar

Posts: 4662
Contributes: 1969

Gender: _MALE_
Online: No
Date: 06/06/2008 10:01
Re: javascript in blocks
#post7957
Forget the banner

Create a file called block_NAME.php in blocks/ with this content:

code
<?php

if (stristr(htmlentities($_SERVER['PHP_SELF']), "block_blockname.php")) {
      die("Error: This file cannot be opened directly!");
}

?>

<script>
....
</script>
Delete Edit Quote
 
ravi
Junior Member
Avatar

Posts: 17
Contributes: 2

Gender: _NEUTRAL_
Online: No
Date: 18/06/2008 04:17
Re: javascript in blocks
#post8281
Ahh Awesome Thanks guys. I got it working now SmileSmile
Delete Edit Quote
 
Reply
Tags Cloud
Advertising
News Archive
Language
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.103.63.59

Username
Password
New files
MemHT Wiki
Friends
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo