Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Comments pagination  (Read 7654 times)

0 Members and 1 Guest are viewing this topic.

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
Comments pagination
« on: October 18, 2003, 06:02:04 pm »

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

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Comments pagination
« Reply #1 on: October 19, 2003, 04:45:15 am »

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:

Code: [Select]

$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
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Comments pagination
« Reply #2 on: October 19, 2003, 04:48:40 am »

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
Logged
SANIsoft PHP applications for E Biz

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Comments pagination
« Reply #3 on: October 19, 2003, 04:52:38 am »

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
Logged

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Comments pagination
« Reply #4 on: October 19, 2003, 04:58:07 am »

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:
Code: [Select]

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

and then:
limit $start,$numonpages



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

to the url.

cheers.
ken
Logged

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
Comments pagination
« Reply #5 on: October 19, 2003, 09:36:36 am »

Quote from: "boii"
like this:
Code: [Select]

$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)
Code: [Select]

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

and then:
limit $start,$numonpages

boii

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 65
Comments pagination
« Reply #6 on: October 19, 2003, 04:58:58 pm »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Comments pagination
« Reply #7 on: October 19, 2003, 08:57:28 pm »

@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
Logged

lasa

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
    • Fotos.LaSa.nl
Comments pagination
« Reply #8 on: October 19, 2003, 09:02:27 pm »

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

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 346
  • Tournicoti, Tournicota
    • http://www.sortons.net
Comments pagination
« Reply #9 on: October 19, 2003, 10:12:30 pm »

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
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.