ThemeShaper Forums » Thematic

jQuery question

(2 posts)
  • Started 9 years ago by jackpatterson
  • Latest reply from jackpatterson
  • This topic is not resolved
  1. I am using Executable PHP plugin in order to make a random picture gallery in the left sidebar. I have a variable in php which determines how many pictures are loaded.

    my jquery script looks like this:

    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>

    <script type="text/javascript">
    $(function(){
    var mainH = $("#main").height();
    var sideH = $("#sidebar-navigation").height();
    var length = Math.ceil((mainH-sideH)/300);

    </script>

    How can I send that length variable to the following php?

    All the best,

    Jack Patterson

    Posted 9 years ago #
  2. Hello, I have since realised I'm being a bit of an idiot.

    Can anyone help me implement the following php in javascript (jQuery)?

    <?php
    
    $families = array
      (
      "en"=>array
      (
      "Name_1",
      "Name_2",
      "Name_3",
      "Name_4",
      "Name_5",
      "Name_6",
      "Name_7",
      "Name_8",
      "Name_9",
      "Name_10",
      ),
      "ru"=>array
      (
      "Петра_1",
      "Петра_2",
      "Петра_3",
      "Петра_4",
      "Петра_5",
      "Петра_6",
      "Петра_7",
      "Петра_8",
      "Петра_9",
      "Петра_10",
      ),
      );
    
    $numbers = range(0, $length);
    shuffle($numbers);
    
    ?>
    <?php
    for($n = 0; $n<$length; $n++) {
    $random_1 = $numbers[$n];
    $random_1_tit = $families[ICL_LANGUAGE_CODE][$numbers[$n]];
            echo "<a href=\"http://konchalovsky.info/foundation/images/". ICL_LANGUAGE_CODE ."/archives/" . $random_1 . ".jpg\" title= ". $random_1_tit. " class=\"thickbox\" /><img src=\"http://konchalovsky.info/foundation/images/en/archives/" . $random_1 . "_t.jpg\"  alt=\"\"/></a>";
    
        }
    ?>
    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.