forum.coppermine-gallery.net
No Support => Feature requests => Topic started by: lasa 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?
-
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
-
.. 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
-
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
-
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
-
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
-
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
-
@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
-
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...
-
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