Comments pagination Comments pagination
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Comments pagination

Started by lasa, October 18, 2003, 06:02:04 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

lasa

Hmm, thnx for your friendly post ;). I have a smaller request, how can I let a user view a page if has over 100 comment's post?

boii

Quote from: "lasa"Hmm, thnx for your friendly post ;). I have a smaller request, how can I let a user view a page if has over 100 comment's post?

like this:


$sql = 'SELECT `author_id` FROM `comments` WHERE `author_id` = $id';
$rowcount = mysql_num_rows($sql);

if ($rowcount < 100)
   {
        die("no access");
   }
    else {
     echo("the page");
   }


thats essentially one easy way of doign the structure. i do somethign similar elsewhere but with userlevels and an actual secure package.

anway.
.. ill code it for you for $100. (bring the chaos back!) ;)

cheers.
ken

Tarique Sani

Quote from: "boii".. ill code it for you for $100. (bring the chaos back!) ;)
:lol:  :lol:

I guess what lasa is saying is 100s of comments should perhaps be broken in to smaller pages

Anyway I am now spliting the thread - please keep one request per thread
SANIsoft PHP applications for E Biz

boii

Quote from: "tarique"Anyway I am now spliting the thread - please keep one request per thread

heh. tarique, can you move my other post in that thread over, i was wirting it while you split this.

cheers.
ken

boii

Quote from: "tarique"I guess what lasa is saying is 100s of comments should perhaps be broken in to smaller pages

oh, thats not too hard either.

really it'd just be a matter of putting a LIMIT in the sql call similar to search results from a sql db.

i use something like:

$numonpages = 5;
if ($start == '') {$start = 0;}
if ($page == '') {$page = 1;}
$start = ($page * $numonpages) - $numonpages;

and then:
limit $start,$numonpages



and then just add like:
&page=<?echo $page +1;?>>
(and -1)

to the url.

cheers.
ken

lasa

Quote from: "boii"like this:
$sql = 'SELECT `author_id` FROM `comments` WHERE `author_id` = $id';
$rowcount = mysql_num_rows($sql);

if ($rowcount < 100)
   {
        die("no access");
   }
    else {
     echo("the page");
   }


thats essentially one easy way of doign the structure. i do somethign similar elsewhere but with userlevels and an actual secure package.

anway.
.. ill code it for you for $100. (bring the chaos back!) ;)

cheers.
ken

Hmm, thnx for that code! To only show up a custom CPG page, I have to put this in a custom page. But the users, who has over the 100 comments, must find that page... Can I show up a link in the main menu, only when the logged-in-user has over the 100 comments?

---

What do you mean with this code: (I don't understand:S)

$numonpages = 5;
if ($start == '') {$start = 0;}
if ($page == '') {$page = 1;}
$start = ($page * $numonpages) - $numonpages;

and then:
limit $start,$numonpages

boii

uh ya, its all very possible.
sorry, i'm not coding it though.

the customization requests youre making are getting out of hand, in my opinion. especially considering its the exact same code i posted.

cheers.
ken

Joachim Müller

@lasa: as you can see from boii's reaction people are not inclined to code very special stuff for you. The features you keep on requesting may be needed on your gallery, but not on others. You can't expect others to do your work. Please keep this in mind and behave yourself!

GauGau

lasa

Yes I know, but maybe there are other users who can use these features as well ;)... I don't wanna press you guys, these are only QUESTIONS. If you don't want to help me. Than have I bad luck...

Rodinou

Or more simply : I KNOW, you don't like CSS ... but ... :)

You place the portion of code CSS where there are comments with

<div style="overflow:auto; position:relative;width:100%; height:HEIGHT_YOU_WANTpx">
Comments
</div>


If you have only 2, or 3 comments, no scrollbars ...
if more, scroll appears ...

Compatible with Mozilla, Opera 7 and IE, of course