4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Egly on September 25, 2005, 12:39:44 AM

Title: Small Credit "System" "MOD"
Post by: Egly on September 25, 2005, 12:39:44 AM
Hi!

At first i have to say, that i cant guarantee, that this mod will work for everybody.
The Reason: I started PHP "coding" three days ago and my whole experience on this comes from 4images installing and modifying...  :mrgreen:
I dont know if it is coded correctly so the real coders may laugh at me but it works for me and that is all i wanted :D

Make BACKUP of all files !

The Mod:

It counts your user´s comments, posts in forum (optional), uploaded images and the image quality (from votes).
For comments users get 5 points, for posts 5 points for uploaded images 5 pts and for and the average image quality multiplyed with 25 = points for quality.
For 50points they get an extra upload.
For example: Standard 20 uploads
Points = 264
Extra Uploads: 5
Global uploads: 25  :mrgreen:

If users want more uploads, they must be active in your galery...

Mods needed:

User Upload Limits                       http://www.4homepages.de/forum/index.php?topic=3607.msg14765#msg14765
Dreamboard 2.1 (optional)            http://www.4homepages.de/forum/index.php?topic=9598.msg45950#msg45950

1. Step:

go to myphpadmin and make the following entry in  4images_users:

field: user_global_limit
type: smallint(3)
Null: No
Standard: 20                                     //here you can change the standard "global uploads"
(radio button click on):  ---                 (dont know how it is called ;-))

2. Step:

Make file: credits.php in your 4images folder and insert (make changes where i commented out):

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: credits.php                                          *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$main_template "credits";

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$user_id $user_info['user_id'];
$user_name $user_info['user_name'];



if (
$user_info['user_level'] >= USER) {
$sql "SELECT user_comments AS comments
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row $site_db->query_firstrow($sql);
$comments = (isset($row['comments'])) ? $row['comments'] : 0;
 
$user_pscomments "<B> ".$row['comments']."</B>\n";
 
$site_template->register_vars("user_pscomments"$user_pscomments);



$sql2 "SELECT COUNT(image_id) AS totimg
         FROM "
.IMAGES_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row2 $site_db->query_firstrow($sql2);
$totimg = (isset($row2['totimg'])) ? $row2['totimg'] : 0;
 
$user_psimages "<B> ".$row2['totimg']."</B>\n";
 
$site_template->register_vars("user_psimages"$user_psimages);



$sql3 "SELECT user_posts AS posts
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row3 $site_db->query_firstrow($sql3);
$posts = (isset($row3['posts'])) ? $row3['posts'] : 0;
 
$user_posts "<B> ".$row3['posts']."</B>\n";
 
$site_template->register_vars("user_posts"$user_posts);



$sql4 "SELECT round(avg(image_rating),2) AS rating 
FROM " 
.IMAGES_TABLE.
WHERE "
.get_user_table_field("""user_id")." = $user_id AND image_rating > 0";

 
$row4 $site_db->query_firstrow($sql4);
$rating = (isset($row4['rating'])) ? $row4['rating'] : 0;
if($row2['totimg'] <> 0) {
$psrating $row4['rating'];}
else {
$psrating="0";
 
}
 
$site_template->register_vars("psrating"$psrating);



$sql5 "SELECT user_global_limit AS globallimit
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row5 $site_db->query_firstrow($sql5);
$limit = (isset($row5['globallimit'])) ? $row5['globallimit'] : 0;
 
$user_global_limitges $row5['globallimit'] ;
 
$site_template->register_vars("user_global_limitges"$user_global_limitges);



$sql6 "SELECT COUNT(image_rating) AS votedimages 
         FROM "
.IMAGES_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id AND image_rating > 0";
 
$row6 $site_db->query_firstrow($sql6);
$votedimages = (isset($row6['votedimages'])) ? $row6['votedimages'] : 0;
 
$user_votedimages $row6['votedimages'];
 
$site_template->register_vars("user_votedimages"$user_votedimages);





if ($row6['votedimages'] <> 0){
$ratingpointsround($row4['rating'] *25/$row6['votedimages'],0);  
}else{ 
$ratingpoints0;
}




$postpoints$row3['posts'] * 5; //Change points for posts here
$imagepoints$row2['totimg'] * 5; //Change points for images here
$commentpoints$row['comments'] * 5 //Change points for comments here
$totalpoints$commentpoints  $imagepoints $postpoints $ratingpoints;
$zusatzuploadsround($totalpoints/50,0);
$uploadsges$zusatzuploads 20;                                                                             //Change default global limit here
$restuploads=$uploadsges $row2['totimg'];





$sql "
UPDATE "
.USERS_TABLE."
SET user_global_limit = 20 + '
$zusatzuploads'
WHERE "
.get_user_table_field("""user_id")." = $user_id";
$site_db->query($sql);


}


$site_template->register_vars(array(
  
"user_psname" => $user_name,
  
"commentpoints" => $commentpoints,
  
"totalpoints" => $totalpoints,
  
"imagepoints" => $imagepoints,
  
"postpoints" => $postpoints,
  
"ratingpoints" => $ratingpoints,
  
"zusatzuploads" => $zusatzuploads,
  
"uploadsges" => $uploadsges,
  
"restuploads" => $restuploads
  
));
   



  
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php'); 
?>

3. Step:

create new file called credits.html (in template folder) from your template and insert this table:

Code: [Select]
<table class="head1" width="600" border="0" cellspacing="0" cellpadding="10">
                              <tr>
                                <td width="367">Credits from  {user_psname} </td>
                                <td width="133">&nbsp;</td>
                              </tr>
                              <tr>
                                <td height="36">You have written {user_pscomments} comments and get: </td>
                                <td><div align="center">{commentpoints} Points</div></td>
                              </tr>
                              <tr>
                                <td height="24" colspan="2"><hr size="1"></td>
                                </tr>
                              <tr>
                                <td height="23">You have uploaded {user_psimages} Images and get for that:</td>
                                <td><div align="center">{imagepoints}  Points</div></td>
                              </tr>
                              <tr>
                                <td height="24" colspan="2"><hr size="1"></td>
                                </tr>
                              <tr>
                                <td height="20">You have posted {user_posts} Posts in the Forum and get: </td>
                                <td><div align="center">{postpoints} Points</div></td>
                              </tr>
                              <tr>
                                <td height="20" colspan="2"><div align="center">
                                  <hr size="1">
                                </div></td>
                                </tr>
                              <tr>
                                <td>Your images are rated with an average of {psrating}, and for this you get:</td>
                                <td><div align="center">{ratingpoints} Points </div></td>
                              </tr>
                               <tr>
                                <td height="20" colspan="2"><div align="center">
                                  <hr size="1">
                                  <hr size="1">
                                </div></td>
                                </tr>
                              <tr>
                                <td>Your Points:</td>
                                <td><div align="center">{totalpoints} </div></td>
                              </tr>
                              <tr>
                                <td>Additional Uploads for your points: </td>
                                <td><div align="center">{zusatzuploads}</div></td>
                              </tr>
                              <tr>
                                <td>Your global upload Limit (images) </td>
                                <td><div align="center">{uploadsges}</div></td>
                              </tr>
                              <tr>
                                <td>Your allready uploaded images: </td>
                                <td><div align="center">{user_psimages}</div></td>
                              </tr>
                              <tr>
                                <td>&nbsp;</td>
                                <td><div align="center"></div></td>
                              </tr>
                              <tr>
                                <td colspan="2"><div align="right">You can upload: {restuploads} images.</div></td>
                                </tr>
                            </table>


4. Step:

in member.php find: ( attention: only availlable if MOD user upload limits is installed!!!)

Code: [Select]
function check_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);

$site_template->register_vars("upload_limit", $upload_limit);

$sql = "SELECT image_id FROM ".IMAGES_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$images_per_user = $site_db->get_numrows($result);

// $sql = "SELECT image_id FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id";
// $result = $site_db->query($sql);
// $tmp_images_per_user = $site_db->get_numrows($result);
// $images_per_user = $tmp_images_per_user + $images_per_user;

// Uncomment above four lines if you also want to check uploaded but not yet validated images against the user limit

$site_template->register_vars("images_per_user", $images_per_user);

if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}

and replace with:

Code: [Select]
function check_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_global_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$global_upload_limit = ($row['user_global_limit']);

$site_template->register_vars("global_upload_limit", $global_upload_limit);

$sql = "SELECT image_id FROM ".IMAGES_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$globalimages_per_user = $site_db->get_numrows($result);

$sql = "SELECT image_id FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$globalimages_per_user = $tmp_images_per_user + $globalimages_per_user;

// Uncomment above four lines if you also want to check uploaded but not yet validated images against the user limit

$site_template->register_vars("globalimages_per_user", $globalimages_per_user);

if($globalimages_per_user >= $global_upload_limit) {
return false;
} else {
return true;
}
}

find:

Code: [Select]
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_picture_limit($user_id))) {
// if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {

//
// Depending on your requirements, you can either check against global or daily limit. For global check leave it as it is now.
// For daily limit comment first line and uncomment second one.
//

$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

and replace with:

Code: [Select]
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_picture_limit($user_id))) {
$site_template->print_template($site_template->parse_template("over_limit2"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {
$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

5. Step:

open from template folder: over_limit.html

delete:

Code: [Select]
{lang_no_limits}

{lang_no_limits_text}
{lang_show_my_images}

and insert any message you want (if users are on their global limt) and save it as over_limit2.html

6. Step:

open in your template folder user_logininfo.html and find:

Code: [Select]
<a href="{url_lightbox}">{lang_lightbox}</a><br>
after that add:

Code: [Select]
<a href="/credits.php">My Points</a><br />

Save and upload all files. It should work ;-)


---------------------------------------------------------------------------

If you dont have installed Dreamboard do as follows:

Delete from credits.php:

Code: [Select]
$sql3 = "SELECT user_posts AS posts
         FROM ".USERS_TABLE."
         WHERE  ".get_user_table_field("", "user_id")." = $user_id";
  $row3 = $site_db->query_firstrow($sql3);
$posts = (isset($row3['posts'])) ? $row3['posts'] : 0;
  $user_posts = "<B> ".$row3['posts']."</B>\n";
  $site_template->register_vars("user_posts", $user_posts);
Code: [Select]
$postpoints= $row3['posts'] * 5; //Punkte für Posts hier eintragen
Code: [Select]
+ $postpoints
In credits.html delete from the table code:

Code: [Select]
                              <tr>
                                <td height="20">You have posted {user_posts} Posts in the Forum and get: </td>
                                <td><div align="center">{postpoints} Points</div></td>
                              </tr>
                              <tr>
                                <td height="20" colspan="2"><div align="center">
                                  <hr size="1">
                                </div></td>
                                </tr>
                              <tr>

Done.

------------------------------------------------------
Question so someone who is really able to code php:
My problem with this is, that the database entry only gets updated, if  credits.php will be opened.
How can i fix this?

Maybe i could add to index.php:

Code: [Select]
include(ROOT_PATH.'credits.php');
and:

Code: [Select]
$sql = "
UPDATE ".USERS_TABLE."
SET user_global_limit = 20 + '$zusatzuploads'
WHERE ".get_user_table_field("", "user_id")." = $user_id";
$site_db->query($sql);


}

Will that work?

Greez Egly
Title: Re: Small Credit "System" "MOD"
Post by: mawenzi on September 26, 2005, 03:34:42 PM
Hi Egly,

sehr interessant dein "Credit-System" ... und vor allem logisch und schlüssig hier als MOD aufbereitet !

Quote from: Egly
My problem with this is, that the database entry only gets updated, if credits.php will be opened.

Wie wäre es wenn du das "Credit-System" in die functions.php einarbeitest und die credits.php dementsprechend verkleinerst. Das "Credit-System" wäre dann in alle relevanten Seiten (details.php, board.php, credits.php, ...) integriert und man müsste nichts gesondert includen. Ein weiterer Vorteil wäre eine mögliche Anzeige der Gesamtpunktzahl als {totalpoints} im Navigationsmenue mit jeder Seite! In user_logininfo.html z.B.:
Code: [Select]
Meine Punkte: <b>{totalpoints}</b>Für den Gesamtüberblick steht dann ja weiterhin die credits.php zur Verfügung (die ich sehr übersichtlich finde und dem User ständig seine erworbenen Punkte nachvollziehen lässt). Der Link im Menue zur credits.php sollte noch für die Session in der page_header.php registriert werden :
Code: [Select]
"url_credits" => $site_sess->url(ROOT_PATH."credits.php"), so dass in der user_logininfo.html folgendes als Link verwendet wird :
Code: [Select]
&nbsp;&raquo; <a href="{url_credits}">Punkte-Übersicht</a>
Soweit erst mal meine Theorie ... werde dein "Credit-System" dann auch auf einer Prob-Seite für mich testen. Wie das ganze System funktioniert ist ja schon toll auf deiner Seite zu sehen.

mawenzi
Title: Re: Small Credit "System" "MOD"
Post by: beseech on September 27, 2005, 05:01:20 AM
i've set in upload limits - 10

in standard - 10

(on credits.php) 10...


so this works ..?

like this will added +1 ..each x i get "Nº of points" ?

or i need change for 20 on standard ?
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 27, 2005, 09:48:35 AM
Thx mawenzi  ich werde deine Tipps mal testen  :)

@beseech: I dont know what you mean exactly.
You want to know if it will work if you make changes like you told?
Title: Re: Small Credit "System" "MOD"
Post by: Loda on September 27, 2005, 11:33:30 AM
hi,
very nice! and it works!

but the admin(s) got the same limits. what can i do to exclude the admin(s)??
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 27, 2005, 12:28:06 PM
@Loda:


go to myphpadmin and make the following entry in  4images_users:

field: user_admin_bonus
type: smallint(3)
Null: No
Standard: 0                                     
(radio button click on):  ---



now replace the whole code from credits.php with this one:

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: credits.php                                     *
 *        Copyright: (C) 2005 Bastian Egelseer                            *
 *            Email: egly@egly2k.de                                       *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.1                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
$main_template "credits";

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

$user_id $user_info['user_id'];
$user_name $user_info['user_name'];



if (
$user_info['user_level'] >= USER) {
$sql "SELECT user_comments AS comments
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row $site_db->query_firstrow($sql);
$comments = (isset($row['comments'])) ? $row['comments'] : 0;
 
$user_pscomments "<B> ".$row['comments']."</B>\n";
 
$site_template->register_vars("user_pscomments"$user_pscomments);



$sql2 "SELECT COUNT(image_id) AS totimg
         FROM "
.IMAGES_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row2 $site_db->query_firstrow($sql2);
$totimg = (isset($row2['totimg'])) ? $row2['totimg'] : 0;
 
$user_psimages "<B> ".$row2['totimg']."</B>\n";
 
$site_template->register_vars("user_psimages"$user_psimages);



$sql3 "SELECT user_posts AS posts
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row3 $site_db->query_firstrow($sql3);
$posts = (isset($row3['posts'])) ? $row3['posts'] : 0;
 
$user_posts "<B> ".$row3['posts']."</B>\n";
 
$site_template->register_vars("user_posts"$user_posts);



$sql4 "SELECT SUM(image_rating) AS rating
         FROM "
.IMAGES_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id AND image_rating > 0";
 
$row4 $site_db->query_firstrow($sql4);
$rating = (isset($row4['rating'])) ? $row4['rating'] : 0;
if($row2['totimg'] <> 0) {
$psrating round($row4['rating']/$row2['totimg'],2);}
else {
$psrating="0";
 
}
 
$site_template->register_vars("psrating"$psrating);



$sql5 "SELECT user_global_limit AS globallimit
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id";
 
$row5 $site_db->query_firstrow($sql5);
$limit = (isset($row5['globallimit'])) ? $row5['globallimit'] : 0;
 
$user_global_limitges $row5['globallimit'] ;
 
$site_template->register_vars("user_global_limitges"$user_global_limitges);

$sql6 "SELECT COUNT(image_rating) AS votedimages 
         FROM "
.IMAGES_TABLE."
         WHERE  "
.get_user_table_field("""user_id")." = $user_id AND image_rating > 0";
 
$row6 $site_db->query_firstrow($sql6);
$votedimages = (isset($row6['votedimages'])) ? $row6['votedimages'] : 0;
 
$user_votedimages $row6['votedimages'];
 
$site_template->register_vars("user_votedimages"$user_votedimages);


$sql7 "SELECT user_admin_bonus AS bonus 
         FROM "
.USERS_TABLE."
         WHERE  "
.get_user_table_field("""user_id")."= $user_id";
 
$row7 $site_db->query_firstrow($sql7);
$bonus = (isset($row7['bonus'])) ? $row7['bonus'] : 0;
 
$user_bonus $row7['bonus'];
 
$site_template->register_vars("user_bonus"$user_bonus);



if ($row6['votedimages'] <> 0){
$ratingpointsround($row4['rating'] *25/$row6['votedimages'],0);
}else{ 
$ratingpoints0;
}
$postpoints$row3['posts'] * 5; //Points for Posts
$imagepoints$row2['totimg'] * 5; //Points for Images
$commentpoints$row['comments'] * 5 //Points for Comments
$bonuspoints $user_bonus;
$totalpoints$commentpoints $bonuspoints $imagepoints $postpoints $ratingpoints;
$zusatzuploadsround($totalpoints/50,0);
$uploadsges$zusatzuploads 20;
$restuploads=$uploadsges $row2['totimg'];

$sql "

UPDATE "
.USERS_TABLE."
SET user_global_limit = 20 + '
$zusatzuploads'
WHERE "
.get_user_table_field("""user_id")." = $user_id";
$site_db->query($sql);




}


$site_template->register_vars(array(
  
"user_psname" => $user_name,
  
"commentpoints" => $commentpoints,
  
"totalpoints" => $totalpoints,
  
"bonuspoints" => $bonuspoints,
  
"imagepoints" => $imagepoints,
  
"postpoints" => $postpoints,
  
"ratingpoints" => $ratingpoints,
  
"zusatzuploads" => $zusatzuploads,
  
"uploadsges" => $uploadsges,
  
"restuploads" => $restuploads
  
));
   



  
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php'); 
?>


Now add to your credits.html this code where you want:

Code: [Select]
<td height="20" colspan="2"><hr size="1"></td>
                              </tr>
                              <tr>
                                <td height="20">Extra Points from the Admin: </td>
                                <td height="20"><div align="center">{bonuspoints} Points</div></td>



This is how i have done it.
You have to set the bonuspoints in the table you created in myphpadmin for every user you want manually.

Egly
Title: Re: Small Credit "System" "MOD"
Post by: Loda on September 27, 2005, 01:00:01 PM
hi,
thank you!
it's an other way to exclude the admin..  :lol:
but it's ok for me.
next question  :roll: : i want to set the bonuspoints over the ACP, possible?
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 27, 2005, 01:09:54 PM
Oh yes, sure its possible.

But too hard for me to code...

If i have the time, i will try it  :D
Title: Re: Small Credit "System" "MOD"
Post by: beseech on September 27, 2005, 04:04:11 PM
Thx mawenzi ich werde deine Tipps mal testen :)

@beseech: I dont know what you mean exactly.
You want to know if it will work if you make changes like you told?

I've just changed the valours 20 to 10 ;)


And what the difference between the old creadits.php and this new one ?
Title: Re: Small Credit "System" "MOD"
Post by: mawenzi on September 27, 2005, 08:54:55 PM
@ beseech

please use : this (http://www.google.de/language_tools?hl=en) !
...  :?:  ...
the code is for a reg.-session-link to credits.php in the nenue in user_logininfo.html ...  :!:

mawenzi
Title: Re: Small Credit "System" "MOD"
Post by: beseech on September 27, 2005, 11:15:05 PM
ah ok, my german isn't so good......


 :roll:
Title: Re: Small Credit "System" "MOD"
Post by: Michael on September 27, 2005, 11:25:41 PM
Hallo, ein großartiger Mod  :D

Wie werden die ratingpoints berechnet und wie kann man eine Kategorie oder einen Gaststatus von dieser Regelung befreien?

In meiner Galerie habe ich eine Testfoto Kategorie in der Gäste auch ohne Anmeldung ein Foto posten können, dies ist nun aber nicht mehr möglich.

Gruß, Michael
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 28, 2005, 12:35:10 AM
Hi!

Die ratingpoints werden so berechnet: Alle wertungen deiner Bilder werden einfach addiert und dann durch die Anzahl der gesamtbilder geteilt.
Ein Problem dabei ist, dass ich es noch nicht geschafft habe nur durch die Bilder zu teilen, bei denen die Wertung nicht null ist.
d.h. wenn du 2 Bilder oben hast, das erste ist mit 5 bewertet das zweite gar nicht, so ist dein durchschnittswert 2,5...

Ich weiß aber nicht wie ich Werte aus einer Tabelle abfrage, die nicht null sind, vielleicht hat ja wer nen Tipp?
Hier der bereich der Abfrage:
Code: [Select]
$sql4 = "SELECT SUM(image_rating) AS rating
         FROM ".IMAGES_TABLE."
         WHERE  ".get_user_table_field("", "user_id")." = $user_id AND image_rating > 0";
Title: Re: Small Credit "System" "MOD"
Post by: Michael on September 28, 2005, 12:44:23 AM
Deswegen mein merkwürdiger Durchschnitt von 0,45 Punkten  :?

Ich selber habe 78 Bilder oben und da ich vor kurzem alle Bewertungen resetet habe, sind nur 4 oder 5 Bewertungen zu meinen Bildern vorhanden  :oops: 

Gruß, Michael
Title: Re: Small Credit "System" "MOD"
Post by: beseech on September 28, 2005, 12:46:15 AM
I've a ideia.... maybe bit hard ... but and if we create points (levels) for example :


500 points - jr. member
1000 points - full member

And showing this rank names in profiles ...

just a ideia ;)
Title: Re: Small Credit "System" "MOD"
Post by: Michael on September 28, 2005, 02:12:32 PM
Merkwürdigerweise greift nun die Funktion des Upload-limits (bei mir 24 Std) nicht mehr, irgend etwas stimmt da nun in der member.php nicht mehr.
Title: Re: Small Credit "System" "MOD"
Post by: PetraK on September 28, 2005, 06:46:43 PM
Ich habe das gleiche Problem, User können - seit dem ich das in member.php wie beschrieben geändert habe - keine Fotos mehr uploaden. Es erscheint beim Upload die Meldung, dass das Limit erreicht sei, was nach Anfrage eines Users nicht korrekt ist, weil der User drei Tage lang keine Fotos hochgeladen hat.

Grüsse PetraK
Title: Re: Small Credit "System" "MOD"
Post by: Michael on September 28, 2005, 09:08:16 PM
Hochladen können die User schon, soweit funktioniert der Mod wunderbar aber das Upload-Limit (je 24 Std. ein Bild) greift nicht mehr und die User können soviel posten wie sie wollen  :roll:
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 29, 2005, 12:13:34 AM
hmmm komisch.

Ihr könnt mal versuchen in der member.php den code von

Code: [Select]
//------------------------------------------------------------
//----------------------Check User Limits --------------------
//------------------------------------------------------------

bis einschließlich
Code: [Select]
$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

durch den hier zu tauschen:

Code: [Select]
//------------------------------------------------------------
//----------------------Check User Limits --------------------
//------------------------------------------------------------

$user_id = $user_info['user_id'];

$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['file_upload_error']."</span>";

$site_template->register_vars(array(
"clickstream" => $clickstream,
"lang_no_limits" => $lang['no_limits'],
"lang_no_limits_text" => $lang['no_limits_text'],
"lang_already_loaded" => $lang['already_loaded'],
"lang_show_my_images" => $lang['show_my_images'],
"lang_limits_global" => $lang['limits_global'],
"url_show_user_images" => $site_sess->url(ROOT_PATH."search.php?search_user=".$user_info['user_name'])
));


function check_daily_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);
$site_template->register_vars("upload_limit", $upload_limit);

$limit_cutoff = time() - 60 * 60 * 24;

$sql = "SELECT image_id, image_date FROM ".IMAGES_TABLE." WHERE user_id=$user_id AND image_date > $limit_cutoff ORDER BY image_date ASC";
$result = $site_db->query($sql);
$images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_image_date = ($row['image_date']);

$sql = "SELECT image_id, image_date FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id ORDER BY image_date ASC";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_tmp_image_date = ($row['image_date']);
$images_per_user = $tmp_images_per_user + $images_per_user;

$latest_image_date = $latest_tmp_image_date > $latest_image_date ? $latest_tmp_image_date : $latest_image_date;
$time_to_go = gmstrftime("%H hrs %M min %S sec", 86400 - (time() - $latest_image_date));

$site_template->register_vars("images_per_user", $images_per_user);
$site_template->register_vars("time_to_go", $time_to_go);

if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}

function check_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_global_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$global_upload_limit = ($row['user_global_limit']);

$site_template->register_vars("global_upload_limit", $global_upload_limit);

$sql = "SELECT image_id FROM ".IMAGES_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$globalimages_per_user = $site_db->get_numrows($result);

$sql = "SELECT image_id FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$globalimages_per_user = $tmp_images_per_user + $globalimages_per_user;

// Uncomment above four lines if you also want to check uploaded but not yet validated images against the user limit

$site_template->register_vars("globalimages_per_user", $globalimages_per_user);

if($globalimages_per_user >= $global_upload_limit) {
return false;
} else {
return true;
}
}

if ($action == "uploadform") {
 if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
  show_error_page($lang['no_permission']);
  exit;
 }

if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_picture_limit($user_id))) {
$site_template->print_template($site_template->parse_template("over_limit2"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {

//
// Depending on your requirements, you can either check against global or daily limit. For global check leave it as it is now.
// For daily limit comment first line and uncomment second one.
//

$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

Das ist der Code von meiner member.php und bei mir funzts auch. Ich habs extra nochmal getestet.
Title: Re: Small Credit "System" "MOD"
Post by: beseech on September 29, 2005, 02:49:49 AM
someone can tell me in english for what this is ...?

:roll:
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 29, 2005, 07:49:00 AM
The both above have the problem, that they dont have the 24h Limit any more.
I told them to replace in member.php from
Code: [Select]
//------------------------------------------------------------
//----------------------Check User Limits --------------------
//------------------------------------------------------------
to
Code: [Select]
$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

with this code:

Code: [Select]
//------------------------------------------------------------
//----------------------Check User Limits --------------------
//------------------------------------------------------------

$user_id = $user_info['user_id'];

$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['file_upload_error']."</span>";

$site_template->register_vars(array(
"clickstream" => $clickstream,
"lang_no_limits" => $lang['no_limits'],
"lang_no_limits_text" => $lang['no_limits_text'],
"lang_already_loaded" => $lang['already_loaded'],
"lang_show_my_images" => $lang['show_my_images'],
"lang_limits_global" => $lang['limits_global'],
"url_show_user_images" => $site_sess->url(ROOT_PATH."search.php?search_user=".$user_info['user_name'])
));


function check_daily_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);
$site_template->register_vars("upload_limit", $upload_limit);

$limit_cutoff = time() - 60 * 60 * 24;

$sql = "SELECT image_id, image_date FROM ".IMAGES_TABLE." WHERE user_id=$user_id AND image_date > $limit_cutoff ORDER BY image_date ASC";
$result = $site_db->query($sql);
$images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_image_date = ($row['image_date']);

$sql = "SELECT image_id, image_date FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id ORDER BY image_date ASC";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_tmp_image_date = ($row['image_date']);
$images_per_user = $tmp_images_per_user + $images_per_user;

$latest_image_date = $latest_tmp_image_date > $latest_image_date ? $latest_tmp_image_date : $latest_image_date;
$time_to_go = gmstrftime("%H hrs %M min %S sec", 86400 - (time() - $latest_image_date));

$site_template->register_vars("images_per_user", $images_per_user);
$site_template->register_vars("time_to_go", $time_to_go);

if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}

function check_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_global_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$global_upload_limit = ($row['user_global_limit']);

$site_template->register_vars("global_upload_limit", $global_upload_limit);

$sql = "SELECT image_id FROM ".IMAGES_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$globalimages_per_user = $site_db->get_numrows($result);

$sql = "SELECT image_id FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$globalimages_per_user = $tmp_images_per_user + $globalimages_per_user;

// Uncomment above four lines if you also want to check uploaded but not yet validated images against the user limit

$site_template->register_vars("globalimages_per_user", $globalimages_per_user);

if($globalimages_per_user >= $global_upload_limit) {
return false;
} else {
return true;
}
}

if ($action == "uploadform") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
  show_error_page($lang['no_permission']);
  exit;
}

if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_picture_limit($user_id))) {
$site_template->print_template($site_template->parse_template("over_limit2"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {

//
// Depending on your requirements, you can either check against global or daily limit. For global check leave it as it is now.
// For daily limit comment first line and uncomment second one.
//

$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}
Title: Re: Small Credit "System" "MOD"
Post by: Michael on September 29, 2005, 10:10:45 AM
Hallo Egly,

ich habe das nun so geändert wie beschrieben, doch der Fehler bleibt bestehen, die 24 Stunden-sperre ist immer noch ausgehebelt.

Hier der Ausschnitt aus der member.php

Code: [Select]
//------------------------------------------------------------
//----------------------Check User Limits --------------------
//------------------------------------------------------------

$user_id = $user_info['user_id'];

$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if ($cat_id && isset($cat_cache[$cat_id])) {
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
}
$clickstream .= $lang['file_upload_error']."</span>";

$site_template->register_vars(array(
"clickstream" => $clickstream,
"lang_no_limits" => $lang['no_limits'],
"lang_no_limits_text" => $lang['no_limits_text'],
"lang_already_loaded" => $lang['already_loaded'],
"lang_show_my_images" => $lang['show_my_images'],
"lang_limits_global" => $lang['limits_global'],
"url_show_user_images" => $site_sess->url(ROOT_PATH."search.php?search_user=".$user_info['user_name'])
));


function check_daily_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$upload_limit = ($row['user_limit']);
$site_template->register_vars("upload_limit", $upload_limit);

$limit_cutoff = time() - 60 * 60 * 24;

$sql = "SELECT image_id, image_date FROM ".IMAGES_TABLE." WHERE user_id=$user_id AND image_date > $limit_cutoff ORDER BY image_date ASC";
$result = $site_db->query($sql);
$images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_image_date = ($row['image_date']);

$sql = "SELECT image_id, image_date FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id ORDER BY image_date ASC";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$row = $site_db->query_firstrow($sql);
$latest_tmp_image_date = ($row['image_date']);
$images_per_user = $tmp_images_per_user + $images_per_user;

$latest_image_date = $latest_tmp_image_date > $latest_image_date ? $latest_tmp_image_date : $latest_image_date;
$time_to_go = gmstrftime("%H hrs %M min %S sec", 86400 - (time() - $latest_image_date));

$site_template->register_vars("images_per_user", $images_per_user);
$site_template->register_vars("time_to_go", $time_to_go);

if($images_per_user >= $upload_limit) {
return false;
} else {
return true;
}
}

function check_picture_limit($user_id) {
global $site_db, $site_template;

$sql = "SELECT user_global_limit FROM ".USERS_TABLE." WHERE user_id = $user_id";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$global_upload_limit = ($row['user_global_limit']);

$site_template->register_vars("global_upload_limit", $global_upload_limit);

$sql = "SELECT image_id FROM ".IMAGES_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$globalimages_per_user = $site_db->get_numrows($result);

$sql = "SELECT image_id FROM ".IMAGES_TEMP_TABLE." WHERE user_id=$user_id";
$result = $site_db->query($sql);
$tmp_images_per_user = $site_db->get_numrows($result);
$globalimages_per_user = $tmp_images_per_user + $globalimages_per_user;

// Uncomment above four lines if you also want to check uploaded but not yet validated images against the user limit

$site_template->register_vars("globalimages_per_user", $globalimages_per_user);

if($globalimages_per_user >= $global_upload_limit) {
return false;
} else {
return true;
}
}

if ($action == "uploadform") {
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_permission("auth_upload", $cat_id))) {
  show_error_page($lang['no_permission']);
  exit;
}

if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_picture_limit($user_id))) {
$site_template->print_template($site_template->parse_template("over_limit2"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}
if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {

//
// Depending on your requirements, you can either check against global or daily limit. For global check leave it as it is now.
// For daily limit comment first line and uncomment second one.
//

$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}

if ($cat_id != 0 && (!isset($cat_cache[$cat_id]) || !check_daily_picture_limit($user_id))) {
$site_template->print_template($site_template->parse_template("over_limit"));
include(ROOT_PATH.'includes/page_footer.php');
exit;
}
Title: Re: Small Credit "System" "MOD"
Post by: PetraK on September 29, 2005, 12:03:37 PM
Hallo Egly,

erst einmal vielen Dank für Dein hervorragendes Modul.


Ich habe auch die Änderung wie oben beschrieben vorgenommen - aber ich habe immer noch das Problem, dass das Limit erreicht wurde, schade  :cry:

Beste Grüsse PetraK
Title: Re: Small Credit "System" "MOD"
Post by: Egly on September 29, 2005, 01:33:34 PM
hmmm, das war eigentlich alles was ich an der member.php verändert hab.

Ihr könnt höchstens mal in myphpadmin die einträge überprüfen.

Die user_global_limit muss auf eurem globalem Limit stehen und die user_limit eben auf dem Tageslimit.

Vorher hats schon funktioniert oder?

Ansonsten wüsste ich dann auch nicht mehr wo der Fehler liegen könnte..
Title: Re: Small Credit "System" "MOD"
Post by: Michael on September 29, 2005, 04:07:32 PM
ich habe gerade noch mal nachgeschaut,
in der user_global_limit steht Standard "5"
in der user_limit steht Standard "1"



Nachtrag:

Ich habe gerade die "alte" member.php wieder aufgespielt und der Fehler ist immer noch vorhanden (keine 24 Std. Upload-sperre),
der Fehler wird sich wohl schon früher eingeschlichen haben  :oops:

Sorry Egly für die Mühe!

Gruß, Michael
Title: Re: Small Credit "System" "MOD"
Post by: beseech on September 29, 2005, 04:36:16 PM
danke Egly  :)
Title: Re: Small Credit "System" "MOD"
Post by: PetraK on September 29, 2005, 06:00:38 PM
@Egly

Also meine alte member.php funktioniert einwandfrei, sowie ich aber die Änderungen in der alten member.php vornehme, funktioniert es nicht mehr. Ich werde noch mal die Einträge in phpmyadmin prüfen, vielleicht hat sich dort ein Fehler eingeschlichen.

Nochmals vielen Dank für Deine Mühe  :P
Title: Re: Small Credit "System" "MOD"
Post by: Michael on November 09, 2005, 02:14:46 PM
wurde Problem das mit den raitingpoints schon gelöst?
Title: Re: Small Credit "System" "MOD"
Post by: lemccoy on November 10, 2005, 10:47:58 PM
Is there anyway to just call this function as per a user?
such as:

http://www.4imagesEXAMPLE.com/credits.php?user=HappyGilmore

and just have the generic table pop up with user points?
Title: Re: Small Credit "System" "MOD"
Post by: Egly on November 11, 2005, 11:23:33 AM
@Michael: Ja, das Problem wurde gelöst. Ich hab den Quellcode aber im Moment nicht da, deshalb werde ichs heute abend posten.

@lemccoy: I dont know what you mean..
do you mean, that guests dont have to see the points table?  :?:

greez
Title: Re: Small Credit "System" "MOD"
Post by: Michael on November 11, 2005, 11:38:03 AM
Hallo Egly,

das wäre sehr nett von Dir :)

Gruß, Michael
Title: Re: Small Credit "System" "MOD"
Post by: lemccoy on November 11, 2005, 03:31:58 PM
Well basically I jsut want to keep track of points with no online benefit whatsover.  The point for this is to give people little gimmicks for participating in the site.  See:
www.drunkisland.com if ya like.

I would like to show a table of the points for each user on the main page.  A small Top 10 points and a link to every user and points maybe?
Title: Re: Small Credit "System" "MOD"
Post by: lemccoy on November 15, 2005, 11:46:16 PM
does the program do this already, and I just need to work on layout?
Title: Re: Small Credit "System" "MOD"
Post by: lemccoy on November 16, 2005, 08:55:36 PM
so basically what i want to do is this - accrue points by action as follows, only for registered users (who must be logged in, of course):

100 image views - 1 point (possible?)
post picture - 5 points
download picture - 1 point
comment on picture - 2 points
vote on picture - 1 point
sign guestbook - 10 points (only once, but i think guestbook handles that part)

then show the # points in the admin/users area

show the # points for top 5 points earners like the top 25.

any takers, suggestions, comments?  I will work some more on this idea tonight see if I can develop anything.
Title: Re: Small Credit "System" "MOD"
Post by: JensF on November 26, 2005, 01:15:47 PM
Hallo,

ich wollte eigentlich nur mal wissen in wie weit der Mod jetzt funktionsfähig ist??? Ich habe noch nicht angefangen ihn einzubauen da ich eben keine Zeit habe. Ich habe mir das Thema hier aber nun kurz übergelesen und es treten/traten ja ne noch ne Menge Fehler auf. Sind die behoben???

Der Mod wäre nähmlich gar nicht schlecht um vielleicht noch ein wenig mehr aktivität in die Galerie zu bringen ;)
Title: Re: Small Credit "System" "MOD"
Post by: Michael on November 26, 2005, 01:40:11 PM
Der Mod funktioniert nun sauber und die User müssen nun auch entsprechend kommentieren um posten zu dürfen  :mrgreen:
Title: Re: Small Credit "System" "MOD"
Post by: JensF on November 26, 2005, 01:44:03 PM
Der Mod funktioniert nun sauber und die User müssen nun auch entsprechend kommentieren um posten zu dürfen  :mrgreen:

Na dann kann ich den ja auch auf meine "What do do" Liste setzen :)

Aber erstmal müssen noch andere Kleinigkeiten erledigt werden...
Title: Re: Small Credit "System" "MOD"
Post by: oswald on December 07, 2005, 10:03:08 PM
How can I show the total number of points in the users profile and along with his comment and forum posts?
Title: Re: Small Credit "System" "MOD"
Post by: tradenet on January 02, 2006, 05:31:52 PM
This is a great MOD, however I have a problem getting people to upload images. I've recently added the Mulitupload MOD and that seems to be helping. It would be great to some how add a point system like this that would maybe allow people to view more images if they upload or...just throwing out ideas.
Title: Re: Small Credit "System" "MOD"
Post by: dosensteck on January 18, 2006, 09:25:34 PM
Hallo Egly,

ich habe selbst auch ein Creditsystem geschrieben, ist zwar nicht so umfangreich wie deines aber funktioniert wunderbar :)
Ich habe mein System direkt in die member.php geschrieben damit ich mir erspare extraseiten zu Bauen. So wird dann direkt beim Upload  überprüft welches Limit man hat :)

Sieht dann so aus... War für mich die einfachste Lösung und denke das es bei dir auch so funktionieren kann :)
Title: Re: Small Credit "System" "MOD"
Post by: JensF on January 19, 2006, 06:54:12 AM
Wie läd man denn 138.12 Bilder hoch :)

Title: Re: Small Credit "System" "MOD"
Post by: Egly on January 19, 2006, 06:51:48 PM
Das in die member.php einbinden is nicht einmal so dumm...
Ich glaub das werd ich auch machen!
Wenns soweit ist, werd ich diesen Thread auch updaten.
Zurzeit sind leider Prüfungen anner FH angesagt...  :roll:

Das mit den 138.12 uploads find ich gut  :)

wie is denn deine hp dosensteck?
Title: Re: Small Credit "System" "MOD"
Post by: dosensteck on January 19, 2006, 10:27:58 PM
www.hobby-fotografen.com

hochgeladen wurden 90 bilder - die kommastellen zählen halt als ein upload :D
Title: Re: Small Credit "System" "MOD"
Post by: Chicco on January 31, 2006, 11:08:43 AM
Also ich habe nun auch diesen Mod eingebaut und funtzt auch soweit ganz okay....Nur habe ich das Problem mit dem Uploadlimit pro tag, das es erst greift, wenn die Bilder freigeschaltet wurden! Ich möchte aber, das er bereits den user hinweisst, das sein uploadlimit erreicht wurde, wenn er gerade bereits zwei Bilder schon hochgeladen hat. Mein Limit liegt bei 2 Bilder pro Tag. Aber mit meinem Testuser (in der Datenbank steht auch bei user_limit die 2 drin) kann ich hochladen und hochladen und hochladen....erst wenn ein paar Bilder freigeschaltet wurden, meckert er...

Was muss ich nun wo machen, damit er bereits vor dem freischalten reagiert`?

UNd wie kann ich als Admin erreichen, das ich von allen Usern die Punktzahl sehen kann? So eine Art Übersichtsliste. Oder kann man sowas in der meberlist mit einbauen? Was müsste ich dazu wo eintragen, damit ich werte wie {totalpoints} anzeigen lassen kann?

Sobald ich in der Index.php den Befehl "include(ROOT_PATH.'credits.php');" oben einbaue, bekomme ich eine Fehlermeldung. Auch wenn ich das mit dem
Code: [Select]
$sql = "
UPDATE ".USERS_TABLE."
SET user_global_limit = 20 + '$zusatzuploads'
WHERE ".get_user_table_field("", "user_id")." = $user_id";
$site_db->query($sql);


}

weglasse oder nicht...Das kommt schon direkt darunter, oder?

Wie gesagt, kein Plan was PHP betrifft.... :?: :|

Und bevor ich es noch vergesse.....Als Admin habe ich bereits 166 Bilder hochgeladen, 2 Bilder wurden bewertet mit insgesamt 18.00 und bekam dafür auch dann 113 Punkte. Als Gesamtbewertung zeigte er mir auch 9.0 an. Somit hat er quasi meine Gesamtwertung (18.00) durch die Anzahl der bewerteten Bilder (2) geteilt, diese mal 25 genommen und dann nochmals durch die Anzahl der bewerteten Bilder (2) genommen...


Als ich aber nun das mit dem Admin-Bonus eingebaut habe, sagt er mir, ich hätte eine Gesamtbewertung von 0.11 und dafür 225 Punkte bekommen...Somit hat er nun quasi meine gesamtbewertung (18.00) durch meine gesamtbildanzahl (166) geteilt, was 0.11 ergibt.... Aber wie kommt er nun auf die 225 Punkte???? Das würde ja nur funktionieren, wen er meine Gesamtbewertung (18.00) durch die Anzahl der bewerteten Bilder teilt und dann mal 25 nimmt. Also wieso teilweise duch meine Gesamtbildanzhal und dann wieder nur durch die Anzahl der bewerteten Bilder???? Sorry, aber blick es gerade gar nicht bzw. weiss gar nicht, wie ich das meinen Usern erklären soll, wenn ich es selbst nicht mehr kapiere....
Title: Re: Small Credit "System" "MOD"
Post by: trez on February 08, 2006, 01:45:30 AM
just a small question - i dont have the userupload restricions mod, and i dont want to have it, any way to include that script without that mod? Because i read that most of the errors are because of the upload mod -
?
Title: Re: Small Credit "System" "MOD"
Post by: trez on March 05, 2006, 01:18:46 AM
ok, i've found a way, just delete some commands in the member_upload.php .
Now i;am trying to show the member-credits in the profile, i'll try dto do it alone, if i succeed i will post it here ;)
Title: Re: Small Credit "System" "MOD"
Post by: Stoleti on March 16, 2006, 03:05:00 AM
i've make a request http://www.4homepages.de/forum/index.php?topic=12119.0 and this mod would be nice combined with my request (give points to who have invite..)  :roll:
Title: Re: Small Credit "System" "MOD"
Post by: Q-man on March 22, 2006, 07:29:25 PM
hi,
very nice! and it works!

haal de muul
Title: Re: Small Credit "System" "MOD"
Post by: Stoleti on March 23, 2006, 05:30:31 AM
Now i;am trying to show the member-credits in the profile, i'll try dto do it alone, if i succeed i will post it here ;)

Any new ? 8)
Title: Re: Small Credit "System" "MOD"
Post by: Loda on March 23, 2006, 10:51:01 PM
Now i;am trying to show the member-credits in the profile, i'll try dto do it alone, if i succeed i will post it here ;)

Any new ? 8)

try this:
1.first in member php search this:
Code: [Select]
    else {
      $user_homepage_button = REPLACE_EMPTY;
    }
after it insert this:
Code: [Select]
      $user_images_limit =  $user_row['user_global_limit'] - $user_row['user_t_images'];
2. search this:
Code: [Select]
  "user_homepage" => $user_homepage,after it insert this:
Code: [Select]
"user_images_limit" => $user_images_limit,3. in member_profile html insert this everywhere you want:
Code: [Select]
{user_images_limit}
i'm right? does it work? i hope so..
Title: Re: Small Credit "System" "MOD"
Post by: Stoleti on March 23, 2006, 11:31:57 PM
Now i;am trying to show the member-credits in the profile, i'll try dto do it alone, if i succeed i will post it here ;)

Any new ? 8)

try this:
1.first in member php search this:
Code: [Select]
    else {
      $user_homepage_button = REPLACE_EMPTY;
    }
after it insert this:
Code: [Select]
      $user_images_limit =  $user_row['user_global_limit'] - $user_row['user_t_images'];
2. search this:
Code: [Select]
  "user_homepage" => $user_homepage,after it insert this:
Code: [Select]
"user_images_limit" => $user_images_limit,3. in member_profile html insert this everywhere you want:
Code: [Select]
{user_images_limit}
i'm right? does it work? i hope so..


thats for the limit of images , the total points its {totalpoints}  8O
Title: Re: Small Credit "System" "MOD"
Post by: timerex on April 14, 2006, 08:33:19 PM
Hallo,
wie kann ich einstellen das man für genung punkte downloads machen kann nicht uploads?
Title: Re: Small Credit "System" "MOD"
Post by: IcEcReaM on April 14, 2006, 09:17:07 PM
das geht nicht so einfach,
da du das Ganze an anderen Stellen ändern müsstest.
Title: Re: Small Credit "System" "MOD"
Post by: timerex on April 15, 2006, 01:42:04 AM
wäre vielleicht jemand bereit da mal was zu machen :)?
Title: Re: Small Credit "System" "MOD"
Post by: wallpapers on April 18, 2006, 09:12:05 PM
please keep this mod in english please so i can follow it  :oops: :roll:
thanks  :D
Title: Re: Small Credit "System" "MOD"
Post by: timerex on April 18, 2006, 10:09:15 PM
i search for this:

if you upload images or write posts you get points to download other images?!
Title: Re: Small Credit "System" "MOD"
Post by: anderitor on April 28, 2006, 06:15:27 PM
i search for this:

if you upload images or write posts you get points to download other images?!

Hello,
I´m looking for the same mod!! Can someone help us?

What I have to do?

Thank you very much for your help!!
Title: Re: Small Credit "System" "MOD"
Post by: Hasi on May 01, 2006, 02:17:17 PM
Hi,

is there a change to implement a mod that subtract Points, when Member viewing a Image. If he don't have any Points, he get a message to upload a image to get more points, otherwise he coud not able to view more pictures?
Title: Re: Small Credit "System" "MOD"
Post by: timerex on May 08, 2006, 09:24:10 PM
nobody an idea?
 :(
Title: Re: Small Credit "System" "MOD"
Post by: Chicco on May 18, 2006, 09:28:15 AM
DEUTSCH
-------------
Ist es möglich, diesen Mod auch so zu verwenden, das z.b. bei einer Mindestpunktzahl bestimmte Kategorien die Detailansicht erst geht?

Also z.B. muss man min. 3 Kommentare erst abgegeben haben (also sprich 15 Punkte mind. besitzen) damit man bei einer bestimmten Kategorie (nehmen wir mal die ID 20) die Bilder auch im Detail sehen kann und nicht nur die Thumbnails?


ENGLISH (Sorry for my Englisch)
--------------------------------------------
Is it possible also in such a way to use this Mod which goes e.g. with a minimum score determined categories the detail opinion only?    One must see min. 3 comments only to have thus e.g. delivered (thus speak 15 points to possess at least) thereby one with a certain category (to take we times the ID 20) the pictures also in the detail can and not only the Thumbnails?
Title: Re: Small Credit "System" "MOD"
Post by: Chicco on May 18, 2006, 09:57:36 AM
Ach ja, habe etwas vergessen.

Es gibt in meiner Galerie eine bestimmte Kategorie noch, die nur bestimmten Mitgliedern zur Verfügung steht. Nur diese bestimmten Mitglieder können auch dort Bilder uploaden.Dort gibt es keine Bewertungen. Auch sollten die Kommentare nicht mitgezählt werden. Als Admin habe ich natürlich dort ebenfalls Bilder hochgeladen, die sonst kein Gast oder normales Mitglied sehen kann.

Jetzt habe ich aber das Problem, das enstprechend gering auch meine Punkteanzahl bei den Bewertungen ist. Hatte z.b. vor kurzem noch eine Bewertungsstand von 0.79 und somit 230 Punkte und als ich weitere Bewertungen erhielt, hatte ich 1.04 und plötzlich nur 213 Punkte dafür bekommen.Versteht ihr wie ich es meine?

Also hier ein ein Beispiel:
Ich habe insgesamt als Admin :
- 52 Kommentare und somit 260 Punkte.
- 161 Bilder hochgeladen und somit 805 Punkte (davon sind aber 69 Bilder in einer Kategorie, die nie eine Bewertung bekommen, weil sie nur bestimmte Mitglieder sehen können)
- 1.01 Bewertungen und somit 213 Punkte (zuvor hatte ich 0,79 Bewertungen und 230 Punkte! Also mehr!!!)

Ist es nun also möglich, bestimmte Kategorien von diesem Punktesystem auszuschließen? Oder das System bei den Gesamtbildern zuvor die Bilder aus der bestimmten Kategorie weglässt? Weil sonst stimmt einfach das Verhältnis nicht mehr.

ENGLISH ( Sorry for my English)
-------------------------------------------
Oh, something forgot.   
There is a certain category still, which is to only certain members at the disposal in my gallery. Only these certain members can uploaden also there pictures. There there are no evaluations. Also the comments should not be taken in account. As Admin I likewise high-loaded pictures naturally there, which otherwise no guest or normal member can see.   

Now I have however the problem, which is enstprechend small also my number of points with the evaluations. E.g. recently and as if I had evaluation conditions of 0.79 and thus 230 points further evaluations still received, I had 1,04 and suddenly only 213 points for it receive. Do you understand like I it my?   

Thus here an example: 
I have altogether as Admin: 
- 52 comments and thus 260 points. 
- 161 pictures high-loaded and thus 805 points (of it however 69 pictures are in a category, which never get an evaluation, because they can see only certain members) 
- 1,01 evaluations and thus 213 points (before I had 0.79 evaluations and 230 points! Thus more!!!)   

Is it now thus possible to exclude certain categories from this point system? Or the system with the overall views the pictures from the certain category omits before? Because otherwise simply the relationship is not correct any longer.
Title: Re: Small Credit "System" "MOD"
Post by: Chicco on May 24, 2006, 11:00:29 AM
MICHAEL:

Du hast folgendes mal hier geschrieben:
Quote
Der Mod funktioniert nun sauber und die User müssen nun auch entsprechend kommentieren um posten zu dürfen

Also habe ich das richtig verstanden? Wer entsprechend kommentare abgegeben hat, darf auch dann posten? Habe ich was übersehen in diesem Mod?
Wenn das auf Bezug von Kommentaren geht bzw. Einschränkung aufs Posten, müsste dies doch auch auf Kategorien gehen, oder? Also ab 50 Punkte kann man die Details sehen. Die BAfrage müsste zumindest fast gleich sein...
Title: Re: Small Credit "System" "MOD"
Post by: Michael on May 24, 2006, 11:07:47 AM
Quote
Also habe ich das richtig verstanden? Wer entsprechend kommentare abgegeben hat, darf auch dann posten? Habe ich was übersehen in diesem Mod?

Mit "posten" meine ich Bilder hochladen, quasi als "Belohnung"

Quote
Wenn das auf Bezug von Kommentaren geht bzw. Einschränkung aufs Posten, müsste dies doch auch auf Kategorien gehen, oder?

keine Ahnung ob dieses dann noch funktionieren würde?
Title: Re: Small Credit "System" "MOD"
Post by: Chicco on May 24, 2006, 11:10:12 AM
 :lol:
Ach so.... Okay, mißverstanden.....Posten bezieht sich bei mir eben auf Kommentare usw.. nicht aufs uploaden..

Trotzdem Danke für die schnelle Antwort.
Nun, dann werde ich mal weitersuchen müssen....um sowas hinzubekommen....

Hat übirgens jemand schon mal das gnaze in der functions.php eingebaut und die credits.php entsprechend abgespeckt, so wie es Mawenzi vorgeschlagen hat? Wenn ja, wie erreiche ich sowas bzw. was muss ich wo dann einbauen?

Title: Re: Small Credit "System" "MOD"
Post by: lemccoy on June 01, 2006, 04:11:54 PM
I can get this to show up when I log in and access credits.php:

Code: [Select]
Credits from DrunkIslander   
You have written 2 comments and get:  10 Points

--------------------------------------------------------------------------------
 
You have uploaded 225 Images and get for that: 1125 Points

--------------------------------------------------------------------------------
 
Your images are rated with an average of 5.00, and for this you get: 42 Points 

--------------------------------------------------------------------------------
 
Your Points: 1177 
Your have uploaded images:  225

What I would like to do is to be able to have something so when member_profile.html is used it shows the "Your Points".  How do I call credits.php from other users if not logged in?  I want to be able to see this:


Code: [Select]
Control Panel
--------------------------------------------------------------------------------
User profile of: DrunkIslander Display all images added by DrunkIslander
Join Date: 09.23.2005
Last Activity: 06.01.2006 10:09
Comments: Show user's comments (2 total)
Email: admin at drunkisland.com
Homepage: http://www.drunkisland.com
ICQ: 
Total Points:  1177
 

I added the total points: 1177 in there - how do I have that show up in the member_profile.html?  I have tried the {totalpoints} and the post by Trez.
Title: Re: Small Credit "System" "MOD"
Post by: Michael on June 14, 2006, 10:07:06 AM
besteht die Möglichkeit die Punkte nach der Anzahl der Zeichen zu zählen,
z.B. 10 zeichen = 1 Punkt

So könnten die User belohnt werden die auch entsprechend lange Kommentare abgeben  :wink:

Gruß, Michael
Title: Re: Small Credit "System" "MOD"
Post by: Chicco on June 23, 2006, 03:45:13 PM
Ich würde gerne den Mod so betreiben, das bei der Bewertung nun die Anzahl der Bilder verwendet wird, die bewertet wurden und nicht die Gesamtanzahl (sprich auch Biolder ohne Bewertungen). Denn es gibt bei mir viele faule Mitglieder, die keine Bwertungen abgeben. Somit bekommt man ein sehr geringen Punktestand, obwohl z.b. zwie Bilder die Gesamtnote von 9 oder 10 haben....Man müsste also quasi nur duch die Anzahl der Bilder teilen, die auch bewertet wurden und nicht durch die Anzahl der Gesamtbilder.

Ist dies nicht möglich??
Title: Re: Small Credit "System" "MOD"
Post by: timerex on June 28, 2006, 02:50:35 PM
i search for this:

if you upload images or write posts you get points to download other images?!

hmm ich und einige andere würden uns bestimmt sehr darüber freuen wenn das jemand hinbekommt. Eigentlich dürfte es ja nicht so schwer sein oder?

bitte:)

Title: Re: Small Credit "System" "MOD"
Post by: troopers on January 19, 2007, 11:38:04 AM
besteht die Möglichkeit die Punkte nach der Anzahl der Zeichen zu zählen,
z.B. 10 zeichen = 1 Punkt

So könnten die User belohnt werden die auch entsprechend lange Kommentare abgeben  :wink:

Gruß, Michael

Hier:

credits.php

einfach irgendwo zwischen den anderen einfügen:
Code: [Select]
$sql7 = "SELECT sum(length(comment_text)) AS totlaenge
         FROM ".COMMENTS_TABLE."
         WHERE  ".get_user_table_field("", "user_id")." = $user_id";
  $row7 = $site_db->query_firstrow($sql7);
$totlaenge = (isset($row7['totlaenge'])) ? $row7['totlaenge'] : 0;
  $user_pslaenge = "<B> ".$row7['totlaenge']."</B>\n";
  $site_template->register_vars("user_pslaenge", $user_pslaenge);

dann weiter unten, nämlich wo das hier steht:
Code: [Select]
$imagepoints= $row2['totimg'] * 5; //Change points for images here
$commentpoints= $row['comments'] * 5; //Change points for comments here

das einfügen: (er multipliziert alle Zeichen)
Code: [Select]
  $laengepoints = $row7['totlaenge'] * 20;
die 20 durch die Punkte ersetzen, die Ihr für ein Zeichen geben wollt!

Wenn er nur alle 'x' mit Punkten versehen soll, dann einfach das hier: wird durch 10 geteilt und dann mit 20 multipliziert.
Code: [Select]
  $laengepoints = $row7['totlaenge']/10 * 20;
und wieder ein Paar Zeilen tiefer,   nämlich hier drin:
Code: [Select]
$site_template->register_vars(array(
  "user_psname" => $user_name,

das einfügen:
Code: [Select]
"laengepoints" => $laengepoints,
und im template "credits.html" das benutzen
Code: [Select]
{laengepoints}.

somit zählt er nun alle Zeichen der Kommentare, die der einzelne User geschrieben hat. Habs vorsichtshalber auch ausprobiert [obwohl ich's nicht brauche.] und funktioniert.

Andere Frage, wo ist da der Sinn ? (reine Neugier von mir)

fertig & viel Spass :D
Title: Re: Small Credit "System" "MOD"
Post by: drastx on February 09, 2007, 08:47:39 PM
Could anybody re-edit this mod ?
I want to have credit system mod like this:
- users get points for uploading/commenting images
- and loose points for VIEWING images

Title: Re: Small Credit "System" "MOD"
Post by: mawenzi on February 09, 2007, 08:54:11 PM
- and loose points for VIEWING images

... what punishment in a gallery ...  :roll:
Title: Re: Small Credit "System" "MOD"
Post by: drastx on February 23, 2007, 07:13:18 AM
- and loose points for VIEWING images

... what punishment in a gallery ...  :roll:

Heheh, yes - but i want users to comment more and upload more.
Title: Re: Small Credit "System" "MOD"
Post by: BartAfterDark on April 04, 2007, 09:45:42 PM
I'm thinking about something where the users can win a price every month. Like more points you have, the bigger is your chance to win. Anything that thinks it could be done?
Title: Re: Small Credit "System" "MOD"
Post by: SoftDux on May 05, 2007, 03:44:34 PM
Has anyone packaged this great MOD into a quick installable script yet?
Title: Re: Small Credit "System" "MOD"
Post by: Ba$im on August 17, 2007, 04:09:51 PM
thanks
Title: Re: Small Credit "System" "MOD"
Post by: www.katzen.ag on November 25, 2007, 01:25:06 PM
Funktioniert tadellos!!!
Seit dem haben viele meiner User plötzlich """"Lust"""" auf Kommentare abgeben und ins Forum zu schreiben  :mrgreen:

Super Mod, vielen Dank!

www.katzen.ag
Title: Re: Small Credit "System" "MOD"
Post by: xsbucket on June 03, 2008, 07:04:12 AM
Is their something like this with the MULTIUPLOAD MOD??? I have version 1.7.6....can someone help please???
Title: Re: Small Credit "System" "MOD"
Post by: Bob on June 03, 2008, 02:30:04 PM
Sehr interessanter Mod !

Ich suche was ähnliches, und zwar:

- user bekommen Punkte für upload, abgegebene kommentare und bewertungen
- user bekommen Punkte für online Time (oft und lange online = mehr Punkte) - optional
- userliste mit den meisten Punkten
- Punkte im Profil anzeigen
- user können z.B. für 20 Punkte anderen user einen nennen wir es mal stern vergeben und der eine stern zählt dann 20 punkte für den der ihn erhalten hat

was der Mod nicht soll:
- uploadlimit oder andere Limits er soll die user nur animieren mehr Aktivität zu zeigen.

kann mann diesen Mod dazu umwandeln?

Gruss Bob
Title: Re: Small Credit "System" "MOD"
Post by: Loda on October 25, 2011, 10:56:13 AM
hallo !
ich möchte gerne bei der zählungder kommentare, nur die Kommentare zählen, die auf ein fremdes foto abgegeben wurden, nicht auf die eigenen.
kann mir jeamand da weiter helfen? wie muss ich in der credit.php den code ändern?
danke!
Gruss Loda