ThemeShaper Forums » Thematic

Sidebar PHP

(1 post)
  • Started 9 years ago by jackpatterson
  • This topic is not resolved
  1. Hi guys, I'm using the Executable PHP widget to make a multilingual gallery in the sidebar. I am using a PHP array to generate a display a selection of random images. I have a value that defines how many images are to be displayed. I want this value to be driven by the height of the 'main' div area, so that as it expands, the sidebar will always be full of images. I have an idea of the jquery code that I would need to implement this, but I don't really know how to get it to send the variable to the php.

    Here is my php gallery generator (using thick box)

    <div id="docs">
    
    <?php
    
    $length= "5";
    $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>";
    
        }
    ?>
    </div>

    The value $length i want to be determined by something like this:

    var mainReal = $("#main").height();
    		var length = Math.round(mainReal/300);

    Any help would be greatly appreciated,

    all the best,

    Jack

    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.