Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Html? (http://www.mysidiaadoptables.com/forum/showthread.php?t=3712)

MaximumRide 05-17-2012 08:35 AM

Html?
 
Ugh I need a thread for all my questions.... Anyway is there a way to put html coding in a page content? What I want to put in there is this:
Code:

<style>
  .row
  {
    padding-left:10px;background-color:white;
    font-family: verdana, san-serif;font-size: 13px
  }
</style>
<table align=center style="background-color:#C0C0C0";>
  <tr><td background-color:#C0C0C0 align=center width=300 style="font-family:Times New Roman;"><b>Water Dish</td></tr>
  <tr><td id=add1 class=row width=300 align=center>You might want to fill up the dish...</td></tr>
  <tr><td align=center><input type=button value="Fill Water Dish" border=0 onclick="rotate()"></td></tr>
</table>
<script type="text/javascript">
/< !-- Script by hscripts.com -->/
    var arr= new Array();
    arr.push("One of your pets happily bounds over and laps up the water!");
    arr.push("You fill up the dish, but none of your pets seem to be thirsty.");
    arr.push("Several of your pets rush forwards, causing the water to spill!");
    arr.push("One of your smaller pets decides to sit in the water dish.");
    arr.push("One of your pets laps up the water as you fill it.");
    arr.push("Some pets come over to investigate, but none bother to drink it.");
    arr.push("Oh, your water dish is already full!");
   
    function rotate()
    {
    var num= Math.round(Math.random()*3);
    add(num);
    }

    function add(i)
    {
    var chi = document.createTextNode(arr[i]);
    var tab1 = document.getElementById("add1");
        while(tab1.hasChildNodes())
        {
        tab1.removeChild(tab1.firstChild);
        }
    tab1.appendChild(chi);
    }
</script>


Aasixx 05-17-2012 02:49 PM

I click "Source" on the page editor to put in an HTML code. ^^
... but, not all HTML codes work with the CKeditor.

This is Pero's code, I tested it to see if it'd work on Mys sites, and no, it doesn't. It doesn't function right.

AlexC 05-17-2012 02:57 PM

You've got javascript in that. Its a lot harder to insert that then it is anything else.

Abronsyth 05-17-2012 03:05 PM

Yeah, that's mostly Javascript, and it doesn't work in Mysidia sites very well. You could try copying the 'blank.php' file as a new file called 'interact.html' or something like that...though I'm not sure if that'd work? The script is meant for use on Weebly sites and to tie into Myadopts sites...of course, I only did minor editing to it, and did not creature the frame work...

AlexC 05-17-2012 03:13 PM

That probably won't actually work - in my experience, javascript and PHP get along like oil and water. My best suggestion would be an iframe perhaps...?

MaximumRide 05-17-2012 03:43 PM

Oh ok thanks :3

I would I use Iframe?

Hall of Famer 05-17-2012 04:13 PM

Well if it is pure HTML such as table, form and iframe, you can always use this syntax in PHP to convert HTML to PHP string:

PHP Code:

$article_content .= "html text in it, can be letters, numbers, tables, forms..."

Nonetheless, this wont work with javascript. I do believe theres a way to get Javascript to work with Mys, and it shouldnt be hard at all. Anyway this script so far is an enhanced version of MA, although we are diverging fast from the shell of Rusnak Adoptables. If javascript works on MA theres no way it wont work with Mys.

MaximumRide 05-17-2012 04:59 PM

Alright thank HoF :3


All times are GMT -5. The time now is 10:47 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.