WordPress.org

Ready to get started?Download WordPress

Forums

Integrating script into WP page (+plugin?) (3 posts)

  1. YAWPU
    Member
    Posted 7 years ago #

    Hi! There is this somehow neat plugin I found that I would like to modify and integrate into a WP page.

    It's a so called "Magnetic Poetry" AJAX plugin:

    http://www.broken-notebook.com/magnetic/

    http://www.broken-notebook.com/magnetic/info.php

    I tried to play around with the code and couldn't get it to work.

    Any kind soul to help me get started? I tried to search around here also but couldn't a solution (got a couple of hints though).

    Also I thought this could make for a nice little goodie "Fridge Door" plugin. I'd understand if no one was interested in porting this. I never wrote a plugin but was wondering whether that qualify for a start (I know HTML, and enough of CSS/PHP to make my way around WP). I would basically add an admin page where you could manage words and adapt size and some css; I would also like to add some kind of admin "reset" option so words get displayed in a defined initial state.

    TIA^10k!-)

  2. YAWPU
    Member
    Posted 7 years ago #

    I'm still trying...
    Here is more info if someone runs across this:

    Basically, the script I wish to integrate uses AJAX and CPAINT to draw a board where there are word tiles; the user may move tiles around the board and tiles keep user entered locations. Words and locations are kept within a pipe delimited .dat file with and ID key, the word itself and coordinates (33|than|566|378). The file is writable so when a tile is being moved, the coordinates get updated.

    See it here : http://www.broken-notebook.com/magnetic/

    The distribution consist in an index file calling the main script which uses CPAINT php files and several .js files.
    All these files are in a same (script root) directory.

    What I tried was to create a "magnet" page template calling a custom header where I put the meta, head and body (onload) elements used by the script (referring to css and js files).

    I modified the src= references in the main script to point to a directory I created at my web root where I put the actual script files.

    That didn't work. The board would initially get drawn about ok but I couldn't move tiles.

    One specific question : since I'm using friendly url's (mydomain.com/magnets) where should I put the script's directory? I tried both the web root and my theme's directory and it didn't seem to work.

    Any help would be greatly appreciated! TIA.

  3. manidir
    Member
    Posted 7 years ago #

    Well, i know this thread s about 7 months old but i tried to do this, too. I didn t succed either. I succeded i including the script in another file in another directory... but i didn t succed in including it in my WordPress template (even though thats just anothter file in another directory, too), so i guesss it s a WordPress issue. Some reason could be the multiple includes WordPress performes, that could possibly also explain why some vars the script sets global become NULL instead of global... weird.

    Some AJAX Whiz around to help us?

Topic Closed

This topic has been closed to new replies.

About this Topic