doudongdang4483 2014-12-02 13:07
浏览 36

PHP - 将图库中的xyz图像数量分割为超链接

I have a rather hard time figuring out a specific way to split large ammounts of images into hyperlinks. I don`t know how to explain it well, but here is a example what I mean:

"In the pastebin below because I can`t post more than 2 links, marked #A"

On this site, go to "Dias" then hit the button "anzeigen" right of Afrika, in the left 8000 images are split into hyperlinks, always 100 showing at once.

I have to make the way exactly like this, but with a different gallery. Here is the link to the page I`m currently working on:

"In the pastebin below because I can`t post more than 2 links, makred #B"

The same as above, on Dias you will see the gallery and on the left side it should also split them up into hyperlinks.

I pasted the code on pastebin because it`s long: http://pastebin.com/LYbYFcug On line 1. it begins with the .php that makes the gallery on the right frame and on line 126. it starts with the .php which shows the pictures.

I hope you can help me, already stuck since a week on this....

Thank you!

  • 写回答

1条回答 默认 最新

  • doutun1362 2014-12-04 08:34
    关注

    Nevermind, I solved it with array_chunk and the input form:

    $chunk = array_chunk($filecounter, 100);
    
    $minval = 1;
    
    if($num < 100 ){
        $maxval = $num;
    }else{
        $maxval = 100;
    }
    
    $output = "";
    
    
    
    foreach ($chunk as $k){
    
    
    ?>
    
    
    <form action="***.php" target="_blank" method="post">
    <input type="hidden" name="filename" value="<?php foreach($filename as $n => $name){echo $name . " ";} ?>"> 
    <input type="hidden" name="imagelink[]" value="<?php print_r( $img_file) ?>"> 
    <input type="hidden" name="imagethumb[]" value="<?php print_r ($img_folder) ?>"/>
    <input type="hidden" name="count" value="<?php print_r(count($k)); ?>"/>
    <input type="hidden" name="serie" value="<?php echo $id ?>"/>
    <input type="hidden" name="minval" value="<?php print_r($minval) ?>"/>
    <input type="hidden" name="maxval" value="<?php print_r($maxval) ?>"/>
    <input type="submit" value=" <?php  echo $minval." - ".$maxval;  ?>"/>
    </form>
    
    <?php
    $minval = $minval + 100;
    $maxval = $maxval + 100;
    
    }
    ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。