Enjoy unlimited access to all forum features for FREE! Optional upgrade available for extra perks.

Live editable text on a website?

Discussion in 'General Board' started by golddiggerguy, Dec 19, 2009.

Thread Status:
Not open for further replies.
  1. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    I'm looking to show text on a site and have it updateable live from my PC without the need of the viewer having to refresh tha page. (in a box or panel doesn't matter how)

    I've hjad a quick scan on G but nothing stands out.

    Any help would be FAB! :cool:
     
  2. retired_member21

    retired_member21 Retired Member

    Joined:
    Apr 2008
    Posts:
    734
    Likes Received:
    13
  3. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    I want to edit text and then to be reflected live (within seconds anyways) to viewers.

    I'm guessing that demo is a logged in admin view.?
     
  4. retired_member12

    retired_member12 Retired Member

    Joined:
    Aug 2006
    Posts:
    1,498
    Likes Received:
    22
    I use Contribute CS4 for doing this. Possibly not exactly what you're after because it requires you to update, but it does the job, sort of!
     
  5. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    It's prob going to be an ajax script or similar to achieve this.

    I want a line of text to say "1234567890" and then for me to change something and then say "abcdefghijk" as if by magic!

    I will be using WordPress so it might even be a plugin that does it. Maybe :rolleyes:

    Cheers Guys!!! :cool:

    Any more?
     
  6. DomainAngel

    DomainAngel Well-Known Member

    Joined:
    Sep 2006
    Posts:
    1,417
    Likes Received:
    82
    Would have to be some sort of applet like the old days and like widgets and chat help things use. I'm sure there is something you can manipulate.

    Does it have to be indexable?
     
  7. DomainAngel

    DomainAngel Well-Known Member

    Joined:
    Sep 2006
    Posts:
    1,417
    Likes Received:
    82
    No you were right, ajax is best :confused:

    Here is the code you will need.

    Update Part Of A Page Without Refreshing?

    It would involve a lot of calls though, to show live changes, say you want to only change it a few minutes a day, the page would be calling up ever few milliseconds. I suppose you could just change this prior to you needing tomake live changes though and then suspend it once you have finished.
     
    Last edited: Dec 19, 2009
  8. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    Thanks for that link!

    That did seem a good way to start with but is a bit over kill for what I want.

    Might have to get a programmer to write a WP plugin for me ;)
     
  9. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
  10. DomainAngel

    DomainAngel Well-Known Member

    Joined:
    Sep 2006
    Posts:
    1,417
    Likes Received:
    82
    More work than I thought you wanted, but that is excellent.

    North West people are just so smart, wouldn't mind buying a few shares in that guy, he's a clever man.
     
  11. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    Although he's pushing to use it for live events, tweaked a little it can just show one line of text which when edited like he did, will update live.

    Spot on plugin that and I'm sure a few people on here will find uses for it.

    Yes a very clever man from York!

    Im a happy bunny, it might even deserve a Blog post and donation from me tomorrow. :D
     
  12. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    Looking into this a bit more and ity's not just a case of adding the plugin and a config file. You need to set this on the server it's running on too. :rolleyes: Meteor
     
  13. jimm United Kingdom

    jimm Active Member

    Joined:
    Feb 2008
    Posts:
    683
    Likes Received:
    13
    Quick any easy way is to have a script you use to add your text to a database (or overwrite a row in the db if you want less server resources but can get rid of any ability to go back). Then use Ajax to query the db and bring the latest text.

    Shouldnt be that hard, though i havent ever integrated something like that into WP.
     
  14. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    Well not 100% with doing that and if it's not too hard anyone here care to have a bash for a donation? Jimm ;)

    Pref as a wordpress CMS plugin!!
     
    Last edited: Dec 20, 2009
  15. jimm United Kingdom

    jimm Active Member

    Joined:
    Feb 2008
    Posts:
    683
    Likes Received:
    13
    If I get some time Ill have a look see... ;)
     
  16. dtm

    dtm Active Member

    Joined:
    Jan 2009
    Posts:
    762
    Likes Received:
    13
    1) Get a copy of prototype.js from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and include on your page in the <head> tag.

    <script language="javascript" src="./prototype.js"></script>

    2) Create a div on your page
    Code:
    <div id="mymessage"></div>
    3) Before the </body> tag put something like this:

    Code:
    <script language="javascript">
    function update_message(){
    var url = 'mymessage.php';
    var pars = '';
    var target = 'mymessage';
    var myAjax = new Ajax.Updater(target, url, {	method: 'get', parameters: pars});
    
    setTimeout("update_message();",1000);
    }
    
    update_message();
    </script>
    4) Now every second (the 1000 part) the div will update with whatever mymessage.php is. Now you just need to add some code in mymessage.php to read a file or pull the message from the database. (Or you could edit that directly file directly)

    5) If not editing the file directly, write another control panel to edit the message in the file or update the database.

    Hope this helps. There are more complicated ways but this is simple ;)
     
  17. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    Thanks for that info dtm and also the offer jimm (very welcome!). Tried the above but no luck :( (prob down to me)

    I may need my hand holding a lttle or a demo in place and hand holding LOL
     
  18. dtm

    dtm Active Member

    Joined:
    Jan 2009
    Posts:
    762
    Likes Received:
    13
    I'll put together a demo. Will post details soon.

     
  19. golddiggerguy United Kingdom

    golddiggerguy Well-Known Member

    Joined:
    Apr 2007
    Posts:
    3,627
    Likes Received:
    28
    FAB! This would make a good WordPress plugin like the Live Blogging one. ;)

    Maybe using ID's to have multiple ones.
     
  20. dtm

    dtm Active Member

    Joined:
    Jan 2009
    Posts:
    762
    Likes Received:
    13
    I've put this together very very quickly. Ideally you want to lock away the edit features so that only you can get at them.

    Demo here: AJAX Message Demo for golddiggerguy

    Try opening two web browsers so you can change from one and view the update on the other.

    Download files here: http://cloudpowered.co.uk/message-demo/message-demo.zip

    You will need to alter the permissions on message.txt in /data/ to allow writing to make it work on your hosting. (chmod 666)
     
Thread Status:
Not open for further replies.