Englishwillame wrote:
greate work,great plug,i like it.
Thanks :)
greate work,great plug,i like it.
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 :)
Hi there, I've not got this installed yet, but it sounds great - are you going to update it for 2.4?
EvilKant wrote:
ddtddt wrote:
What your OS ?
mac ? linux ? windows ?windows XP
Dowload and install tortoiseSVN -> http://tortoisesvn.net/downloads.html ;-)
ddtddt wrote:
What your OS ?
mac ? linux ? windows ?
windows XP
EvilKant wrote:
ddtddt wrote:
:-)
Can you add on SVN ?First I must understand how it works
What your OS ?
mac ? linux ? windows ?
ddtddt wrote:
:-)
Can you add on SVN ?
First I must understand how it works
EvilKant wrote:
:-)
Can you add on SVN ?
At last I found a solution! I did hidden input and with javascript send data like from form.
<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}Damn... I begin hate jQuery...
If I do this:
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:
<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.
I forgot about POST-method. Whith POST all is working... Now I need turn <a> to "submit".
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
posts.tpl
{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.