Author Topic: Small Credit "System" "MOD"  (Read 90911 times)

0 Members and 1 Guest are viewing this topic.

Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Small Credit "System" "MOD"
« 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

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #1 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
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #2 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 ?

Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #3 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?

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Small Credit "System" "MOD"
« Reply #4 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)??

Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #5 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

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Small Credit "System" "MOD"
« Reply #6 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?

Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #7 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

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #8 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 ?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #9 on: September 27, 2005, 08:54:55 PM »
@ beseech

please use : this !
...  :?:  ...
the code is for a reg.-session-link to credits.php in the nenue in user_logininfo.html ...  :!:

mawenzi
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #10 on: September 27, 2005, 11:15:05 PM »
ah ok, my german isn't so good......


 :roll:

Offline Michael

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #11 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

Offline Egly

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #12 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";

Offline Michael

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #13 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

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: Small Credit "System" "MOD"
« Reply #14 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 ;)