Piwigo.org

You are not logged in. (Register / Login)

Announcement

Post a reply

Write your message and submit

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

EvilKant
2012-11-07 22:53:15

willame wrote:

greate work,great plug,i like it.

Thanks :)

willame
2012-11-07 09:10:11

greate work,great plug,i like it.

EvilKant
2012-06-25 23:21:49

skpManiac wrote:

Hi there, I've not got this installed yet, but it sounds great - are you going to update it for 2.4?

EdwinKort wrote:

And it works with 2.4 :)

skpManiac
2012-06-25 18:23:37

Hi there, I've not got this installed yet, but it sounds great - are you going to update it for 2.4?

ddtddt
2012-06-24 23:21:41

EvilKant wrote:

ddtddt wrote:

What your OS ?
mac ? linux ? windows ?

windows XP

Dowload and install tortoiseSVN -> http://tortoisesvn.net/downloads.html ;-)

EvilKant
2012-06-24 23:18:47

ddtddt wrote:

What your OS ?
mac ? linux ? windows ?

windows XP

ddtddt
2012-06-24 23:02:02

EvilKant wrote:

ddtddt wrote:

:-)
Can you add on SVN ?

First I must understand how it works

What your OS ?
mac ? linux ? windows ?

EvilKant
2012-06-24 22:15:02

ddtddt wrote:

:-)
Can you add on SVN ?

First I must understand how it works

ddtddt
2012-06-24 20:42:26

:-)
Can you add on SVN ?

EvilKant
2012-06-24 20:22:50
EvilKant
2012-04-09 22:34:43

At last I found a solution! I did hidden input and with javascript send data like from form.

Code:

 
<script type="text/javascript">{literal}    
    function subnum (num) {
      document.blog_pagination.npage.value=num;
      document.blog_pagination.submit();
    }
    {/literal}
    </script>
{php}
echo "<input type='text' name='npage' style='visibility: hidden; position: absolute;'>";
for ($it=1; $it<=$pages; $it++) {
  echo "<a class='blog_pagination' href='#' onclick='subnum(";
  echo '"'.$it.'"';
  echo ")'>".$it."</a> | ";
  }
{/php}
EvilKant
2012-04-09 19:26:23

Damn... I begin hate jQuery...

If I do this:

Code:

echo "<input type='text' name='npage'>";
echo "<input type='submit' value='Send'>";

All is working. I can see and first, and second page of blog.

But if I try do this with jQuery, all is not working:

Code:

<script type="text/javascript">{literal}    
    $(function(){
      $('.blog_pagination').click(function() {
        $.post('index.php', {npage: '2'}); //here I just want see second page, but still see first page, and $_POST array still empty.
        });
    return false;
    });
    {/literal}
    </script>
<a class='blog_pagination' href='' rel='".$it."'>".$it."</a>

I think, I misunderstood $.post function, but google can't advise something other... Everything works except line with $.post .

Until I find a solution to this problem, I can't begin do other parts :( . Without paginal output plugin will be unusable.

EvilKant
2012-04-07 17:59:50

I forgot about POST-method. Whith POST all is working... Now I need turn <a> to "submit".

flop25
2012-04-07 13:41:33

I think you just misunderstood the tokens : its a security protection when sensible data are transmitted. A unique string is generated for a very limited time : it's the token
The pagination is used -as far as i remember- in the global $page : you can use this variable too

EvilKant
2012-04-07 11:02:23

posts.tpl

Code:

{php}
  global $tokens;
  $post_per_page = 5;
///////Here I try get number of page from previous session///////////////
  if ($tokens[0] == 'blog_page') {
    if ((!empty($tokens[1])) and ($tokens[1]<=0)) {
      $number = 0;
      } else {
      $npage = $tokens[1];
      $number=($tokens[1]-1)*$post_per_page;
      }
    } else { $number = 0; }
/////////////////////////////////////////////////////////////////////////////////////    
  error_reporting(0);
  $link = mysqli_connect("localhost", "*****", "*****", "picmun");
  if (!$link) {
    echo "MySQL говорит об ошибке: " . mysqli_connect_error();
    }
  
  $query =   "SELECT *
        FROM `evil_blog`
        WHERE 1
        ORDER BY `date` DESC
        LIMIT ".$number.",".$post_per_page;
  $result = mysqli_query($link, $query);  
{/php}
  
  <div class='content' id="comments">
    <div class="titrePage">Новости!
      <ul class="categoryActions"><li>
      </li></ul>
    </div>
    <ul class="thumbnailCategories">
      {php} while ($row = mysqli_fetch_array($result)) { {/php}
        <li>
          <div class="thumbnailCategory">
            {php} echo $row["id"]."* ". $row["date"]." - ".$row["header"];{/php}
            <div class="description">
              {php} echo $row["text"];{/php}
            </div>
          </div>
        </li>
      {php} } {/php}
    </ul>
    <form action="" method="GET">
    
    {php}
      $result = mysqli_query($link, "SELECT COUNT(*) FROM `evil_blog`");  
      $row = mysqli_fetch_array($result);
      $pages = ($row["COUNT(*)"] / $post_per_page)+1;
    {/php}

///////////////////////////Navigation Bar///////////////////////////////////////
    <div class="navigationBar">
      <a href="index.php" rel="first">{'First'|@translate}</a> |
      <a href="index.php?/blog_page/{php}echo $npage-1;{/php}" rel="prev">{'Previous'|@translate}</a> |
          {php}
          for ($it=1; $it<=$pages; $it++) {
            echo '<span class=""><a href="index.php?/blog_page/'.$it.'">'.$it.'</a> | </span>';
          }
          {/php}
      <a href="index.php?/blog_page/{php}echo $npage+1;{/php}" rel="next">{'Next'|@translate}</a> |
      <a href="index.php?/blog_page/{php}echo $pages;{/php}" rel="last">{'Last'|@translate}</a>
    </div>
////////////////////////////////////////////////////////////////////////////////////
    </form>
  </div>
  
{php}  mysqli_close($link);

{/php}

I don't use SMARTY, becouse I want learn PHP.

Maybe I must register $tokens's values? But in "Additional pages" I have not found something like this.

Board footer

Powered by FluxBB

About this website · Donate · Contact Piwigo project © 2002-2013