Announcement

Collapse
No announcement yet.

Random text / html / graphics at upload

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Random text / html / graphics at upload

    Hi,

    Is it possible to embed, either in a template or a fragment, a list of text / html code of which one item in the list will be selected during the actinic upload.

    ie. each time I upload the site, the particular page will have a different piece of text / html in the page html?

    Thanks.

    ps. just to clarify, I do not want the random function to be in the page (so that each time someone refreshes the page they get different text), I want the random bit to happen during upload and then be 'fixed' into the html of the page. Kind of like the actinic variables, that get resolved during the upload...
    John

    #2
    It could be done fairly easily using actinics embedded php but I suspect this isn't available in V7.

    You can set actinic to include external file contents on the page during page generation and you could use excel or something to generate new content for the file. I have done this on V6 for a 'tip of the week' function.

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment


      #3
      is there a way to embed php into normal html?
      John

      Comment


        #4
        1. See the second paragaraph I added for an alternative way to do this.

        2. Yes, you can embed PHP into HTML but this will be run on page generation time and will require the server to be set up to parse all pages for php if use .html extensions rather than .php. This can slow servers down so isn't very popular.

        3. If doing it online then javascript is more efficient but Google can read javascript so this might not achieve what you're after.

        Mike
        -----------------------------------------

        First Tackle - Fly Fishing and Game Angling

        -----------------------------------------

        Comment


          #5
          hmmm.... that could work. I can create a script that creates a text file containing the code, then use an actinic customvar to load the contents of the file... just have to remember to randomize the file before uploading...

          Thanks, I'll give it a go!
          John

          Comment


            #6
            Originally posted by olderscot View Post
            Yes, you can embed PHP into HTML but this will be run on page generation time and will require the server to be set up to parse all pages for php if use .html extensions rather than .php. This can slow servers down so isn't very popular.
            This can also be done with other technologies such as ASP, depending on your server.

            An issue with this however is that it doesn't work for users who have a trade account and are logged in. In such cases, rather than the static HTML being served as normal (and the embedded ASP being executed if the server is so configured), a Perl script reads the source HTML through a filter that inserts the login name, personalised prices etc....

            However, because it's being served via a Perl script, such filtered HTML is *not* then parsed by the ASP engine.

            I haven't investigated whether there's a way around this (yet), or whether the same issue applies to dynamically server-processed PHP pages.

            Originally posted by olderscot View Post
            If doing it online then javascript is more efficient but Google can read javascript so this might not achieve what you're after.
            Do you mean the Javascript source or the results of its execution? It's been stated that since the launch of "Caffeine", Google is capable of parsing Javascript, though it's not clear how far this ability goes.
            - DD

            Inkjet Printer Ink Cartridges
            DVD-R, CD-R, BD-R and Accessories

            Comment


              #7
              Originally posted by jxm28788 View Post
              hmmm.... that could work. I can create a script that creates a text file containing the code, then use an actinic customvar to load the contents of the file... just have to remember to randomize the file before uploading...

              Thanks, I'll give it a go!
              Perhaps you could schedule a task (either via Windows' scheduler or the Unix/Linux cron daemon) that runs automatically once a day, using the date and/or time as a seed for the random-number-generator.

              Or you could simply cycle round a number of values (e.g.) every 7 days.
              - DD

              Inkjet Printer Ink Cartridges
              DVD-R, CD-R, BD-R and Accessories

              Comment


                #8
                thanks, it's all set up and working now.
                John

                Comment


                  #9
                  John - can you post your solution for other v7 users to use.


                  Bikster
                  SellerDeck Designs and Responsive Themes

                  Comment


                    #10
                    Hi,

                    I used the suggestion above - put the text in a text file then use the actinic customvars with the 'is file' and 'use file contents' set to place the text whereever you want on the page.

                    John.
                    John

                    Comment

                    Working...
                    X