Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - trez

Pages: 1 [2] 3 4 5
16
*I would appreciate it, if some MOD can make this thread sticky, because of its importance*

Dear users,

so you decided to get a paid MOD? Well i receive about 5 PM's per days for payed MODs. I'am sure other users receive more.
Well, i'am writing this thread to make my answers easier for 80% of the MOD requests i receive daily.

I don't know how much of you know anything about PHP, HTML, Linux etc. But it seems, that most of the users have really no clue what coding is.
"I have an easy request" , "I assume it wouldn't take too much time", "I know it sounds easy" - are just 3 examples of "starting lines" in some of my unanswered PM's.

Well, first i answered them with a price, or with a request for more information in order to calculate the price. And i hear every time (well, most of the time) the same answer.
"Dude, thats not really cheap", "What, are you crazy" or "More that 50$ for a MOD, are you crazy??" - One of my favorites ;)

Now you have to think that i'am charging too much? No, 15 - 20$ per hour (depending on the time i have), feel free to ask any other pogramer if he work's for less - it's a standard price (well, in Bulgaria they actually give you just 5$ per hour, but that's a different story).

What i'am trying to do with this thread is to ask you to keep these things in mind before you make any request to any user:

- custom modding is PAYED - nothing big comes for free
- "payed" means 30$ and above - "i can link back to your site" doesn't work!
- be sure that you have enough money before you make an request
- know exactly what you want or what you expect

Follow these simple rules and you have no problem. It is really very annoying for us every time to ask the same questions or answer to questions why the request isn't 30$ but 130$.
We're no "n00b's", we also have wifes (maybe children), we drink, we eat and we behave human. Don't think we're all machines that work for free or spend the night in installing 25 mod's on a Portuguese website for 10 bucks (!)

Thank you
George 

PS: Requests for HELP are always free. I have no problem in helping users. But custom modding is something else.
EDIT: Changed my price per hour

17
Hi,

anyone of you has users like {username} ? Or {P}blabla ?
Well, the problem is, that 4images isn't parsing the username right if there is an opening and closing bracket ({ and }). So the user is "invisible" in the who is online, even in his profile,
even in the user administration - everywhere. The user name in the brackets is just not displayed.

Well, this is also a security problem, but i won't write on that topic much further. I was surprised, that even the new version (1.7.4) hasn't resolved that bug. I did find out about this, when "invisible users" start complaining that they can't get PM's and that they cant upload any images or create folders.

So, the bug is in the register.php, and there is a simple solution to resolve this problem.

STEP 1
open your register.php

find:
Code: [Select]
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }

right after the closing } insert:

Code: [Select]
      elseif (preg_match("#[<{}>]#", $user_name))
      {
        $msg .= (($msg != "") ? "<br />" : "").$lang['invalid_symbols'];
        $error = 1;
      }

save and close.

STEP 2

open /lang/english/main.php

find:

Code: [Select]
$lang['username_exists'] = "User name already exists.";
instert right below:

Code: [Select]
$lang['invalid_symbols'] = "Please use only numbers 0-9 and letters A-Z in your username!.";
save and close.


Thats it, now you get rid of the problem. In this example, we have forbidden only the symbols "<>{}", if you want forbid more symbols just add them between the [.....]

For example, if we want to forbid "$%^&*()" the line would look like this:

Code: [Select]
elseif (preg_match("#[<{}>$%^&*()]#", $user_name))

that's it.
Greetings,

George

Developers, this has to be added in the next version!






18
Mods & Plugins (Requests & Discussions) / MOD: Battle MOD (Beta)
« on: January 23, 2007, 08:18:48 PM »
Hi there,

i'am transforming my site more and more into a dating/community portal, well - this is my latest idea. It requires v@nos userpicture mod and the gender mod.

A battle mod

Whats that? Its like a advanced image rating system for users with userpics.
Randomly are 2 userpics displayed, and you choose one of them. The user you've choosen gets one "WIN", the other user gets one "Loose". After that,
the same page is opening again, with 2 new randomly selected user (userpics), and on the right side are you latest two, where you can see how many wins/looses they have,
with link to the member profile. You can select to rate women VS women and men VS men. Member wins/looses are displayed in their profiles as well.

The mod requires 2 new fields in your 4images_users table and contains 4 new files/templates.

WORKING DEMONSTRATION

http://www.zapomnime.com/battle.php  - click on a picture
even if you dont understand the language, you will understand how it works.

Where is the MOD?
Well, i'am searching for betatesters, because i've tested the mod only on a 1.7.1 version, and there are some security bugs (people can rate twice) witch have to be resolved.
So i'am searchin for ONE person who has a working 1.7.4 version with the required mods installed, minimum 100 user with userpics, an ICQ or SKYPE account and some experience in 4images and PHP.

Please write me a PM if you are interested in participating.

UPDATE
- security bug is resolved, voting frauds are now not possible for the normal user ;)










19
One thing i don't like about 4images is that there is no "cut_off" option for the thumbnails. What does that mean? Here you are:

For example you upload these 5 images and you defined 100px as maximal width and 100px as maximum hight. So the thumbnails look like this:



So that doesn't look so good, agree? For example on the mainpage in "New Images", or in the search that can be very bad if you have a good design on you page.
So, i would look better this way:



Agreed? Yes of course. So in this example we specified the exact size of 80X100. This is called a "thumbnail cutoff" and many major cms/image gallery systems have that function.
It just looks better.

What do you think?

I have all the codes we need, buti just can't integrate it, if Kai, Mawenzi or some other more experienced is willing to help me on that on i will appreciate it.






20
This litte mod changes your whole admin control panel into a nicer one ;)

Features

- New, more pleasant colors used
- Left navigation box - shows only the options you want to see with fading slide effect like in Windows XP, remembers you preference with a cookie.
- Removed 4images logo / yellow bar to save some additional space (no version info either)

Please see screen shots and demo for detailed information!


SCREENSHOTS / DEMO

If you just wanna check out the menu, you can look here:
DEMO : http://unfb.info/slide/ - but dont try to click on the links, its just a demonstration
SCREENS:
http://www.unfb.info/slide/1.gif
http://www.unfb.info/slide/2.gif


Install


1. Download admin.zip from the bottom of this post
3. Download the package and extract all files into your 4images/admin directory (overwrite existing ones)
4. Go to www..yoursite.com/admin and say "nice" :D

WARNING
This changes your index.php, home.php and cpstyle.css , so if you have made any changes in this files you have do install it step by step!
But normally those files aren't changed so i assume you can overwrite them.

Plugins Directory

You have to add your plugins manually in order to use this mod. That means that you have to specify he path to each used plugin in your index.php.
For further questions just write ;)


21
Hello,

Many people ask me about the "tweaks" i've installed on my commercial page. I can't reply to everyone, so i decided to publish some of the codes i used.
Today, we start with the details.php.

What

This tweak mod allows you to show options/image info/rating and comments only if the user wants to see them. The script uses cookies to remember the users preferences.

Versions
Tested on 1.7.1/1.7.2/1.7.3/1.7.4 , works on FF 1.0+, IE 5.0+ and Opera

Demo
http://unfb.info/4images/details.php?image_id=3
look under the image ;)



Step 1
open /templates/default/header.html

look for:

Code: [Select]
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/style.css" />

insert below

Code: [Select]
<style type="text/css">
.menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#ECECFF;
color:#000000;
width:100%;
padding:2px;
text-align:center;
font-weight:bold;
/*/*/border:1px solid #000000;/* */
}

.submenu{
margin-bottom: 0.5em;
}
</style>

<script type="text/javascript">

/***********************************************
* Copyright by Martial B of http://getElementById.com/
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
if(el.style.display != "block"){ //DynamicDrive.com change
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu") //DynamicDrive.com change
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

</script>

save and close

Step 2
open /templates/default/details.html

depending on your previous modifications, you have to be careful. But if you use the standard code do the following:

search for:
Code: [Select]
{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
</div>
                  <br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">{image_name}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_description}</b></td>
                            <td valign="top" class="row1">{image_description}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_keywords}</b></td>
                            <td valign="top" class="row2">{image_keywords}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_date}</b></td>
                            <td valign="top" class="row1">{image_date}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_hits}</b></td>
                            <td valign="top" class="row2">{image_hits}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_downloads}</b></td>
                            <td valign="top" class="row1">{image_downloads}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_rating}</b></td>
                            <td valign="top" class="row2">{image_rating} ({image_votes}
                              {lang_votes})</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_file_size}</b></td>
                            <td valign="top" class="row1">{image_file_size}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_added_by}</b></td>
                            <td valign="top" class="row2">{user_name_link}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  {if iptc_info}
<br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">IPTC Info</td>
                          </tr>
                          {iptc_info}
                        </table>
                      </td>
                    </tr>
                  </table>
                  {endif iptc_info}
{if exif_info}
<br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">EXIF Info</td>
                          </tr>
                          {exif_info}
                        </table>
                      </td>
                    </tr>
                  </table>
                  {endif exif_info}
{if rate_form}
                  <br />
<div align="center">{rate_form}</div>
                  {endif rate_form}
{if allow_comments}
<a name="comments"></a>
<br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                    <tr>
                      <td class="head1" valign="top">
                        <table width="100%" border="0" cellpadding="3" cellspacing="1">
                          <tr>
                            <td valign="top" class="head1">{lang_author}</td>
                            <td valign="top" class="head1">{lang_comment}</td>
                          </tr>
                          {comments}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br />
                  {comment_form} {endif allow_comments}

and replace it with:

Code: [Select]
</div>




<div id="masterdiv">

<div class="menutitle" onclick="SwitchMenu('sub1')"><small>+/-</small> Options</div>
<span class="submenu" id="sub1">
{lightbox_button}&nbsp;&nbsp;{postcard_button}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{download_button}&nbsp;&nbsp;{download_zip_button}
</span>

<div class="menutitle" onclick="SwitchMenu('sub2')"><small>+/-</small> Image details</div>
<span class="submenu" id="sub2">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">{image_name}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_description}</b></td>
                            <td valign="top" class="row1">{image_description}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_keywords}</b></td>
                            <td valign="top" class="row2">{image_keywords}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_date}</b></td>
                            <td valign="top" class="row1">{image_date}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_hits}</b></td>
                            <td valign="top" class="row2">{image_hits}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_downloads}</b></td>
                            <td valign="top" class="row1">{image_downloads}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_rating}</b></td>
                            <td valign="top" class="row2">{image_rating} ({image_votes}
                              {lang_votes})</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row1"><b>{lang_file_size}</b></td>
                            <td valign="top" class="row1">{image_file_size}</td>
                          </tr>
                          <tr>
                            <td valign="top" class="row2"><b>{lang_added_by}</b></td>
                            <td valign="top" class="row2">{user_name_link}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  {if iptc_info}
<br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">IPTC Info</td>
                          </tr>
                          {iptc_info}
                        </table>
                      </td>
                    </tr>
                  </table>
                  {endif iptc_info}
{if exif_info}
<br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">
                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                          <tr>
                            <td class="head1" valign="top" colspan="2">EXIF Info</td>
                          </tr>
                          {exif_info}
                        </table>
                      </td>
                    </tr>
                  </table>
                  {endif exif_info}
</span>

<div class="menutitle" onclick="SwitchMenu('sub3')"><small>+/-</small> Rating</div>
<span class="submenu" id="sub3">
{if rate_form}
                  <br />
<div align="center">{rate_form}</div>
                  {endif rate_form}
</span>

<div class="menutitle" onclick="SwitchMenu('sub4')"><small>+/-</small> Comments</div>
<span class="submenu" id="sub4">
{if allow_comments}
<a name="comments"></a>
<br />
                  <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
                    <tr>
                      <td class="head1" valign="top">
                        <table width="100%" border="0" cellpadding="3" cellspacing="1">
                          <tr>
                            <td valign="top" class="head1">{lang_author}</td>
                            <td valign="top" class="head1">{lang_comment}</td>
                          </tr>
                          {comments}
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br />
                  {comment_form} {endif allow_comments} <br />
</span>

</div>

save and close

Step 3 (optional)

If you want to change the style of the links look in the new code in your header.html end edit the css.
I think you understand the algorithm of that code, so custom modifications shouldn't be a problem. For further questions please post in this thread.
Don't remove the copyright


22
Chit Chat / Take a rest guys :)
« on: January 08, 2007, 01:13:58 PM »
Working on 4images can be frustrating sometimes, so when that happens - take a rest,
for example look at some awesome party girls I've got for you :) (NO porn)

| | | |

412 Pictures Link: http://zapomnime.com/categories.php?cat_id=404

Happy browsing :)

23
Chit Chat / Free Webspace for Eastern European Users
« on: January 03, 2007, 01:41:28 PM »
Hi,

Everything is unlimited, i have much resources left on my server. The only thing i want is a banner (450x80) on the main page.
For more information contact me via PM or ICQ 133518282

PS: Please don't write me if:

- your site has LESS than 500 inuque visitors per day
- is not in a Eastern European language

Georgi

24
Hello,

everyone knows me in this forum because of my endless questions in the past. It has been now 2 years since i use 4images.
I can say, that my site is one of the biggest 4images sites i know, (2000-3000 unique users per day / 100.000 hits per day)

I have installed over 60 mods, most of them coded by IcEcReaM (payed mods, only for my site).

Id like to share my experience with 4images, for the new users or undecided ones. If you are planning to make a big site, with much users - don't use it. When i first started to use 4images everything was fine, until i had 20 user simultaneously browsing at mi site. On a dedicated server (Dual P4 3ghz % 1GB Ram) load was around 8-12 / memory around 60-90%. It was because of the way the code is written, to catch all categories on every click. So when you have about 3000 categories your site gets slow.

There were many other things. Why I'am writing this topic? Because i want to warn you. If you plan to go "big", you have to pay big. Using the script for a small community is ok, but don't think 4images can handle 150 simultaneous users and 10.000 categories.

I spend 1900$ for a complete rewrite of 4images in order to solve my problems. It isn't finished yet, but it works. 80% of the code is about to be rewritten, but with only 20-30% untill now i get those results (index.php)

Page generated in 2.584239 seconds with 33 queries, spending 1.147000 seconds doing MySQL queries and 1.437239 doing PHP things. GZIP compression enabled
@ 112 users browsing my site (89 members/23 guests) and 9453 categories

After the rewrite is complete it will be 10-15 times faster.

So folks, if you want to use 4images big, as a community portal, with all the mods and extras you have to rewrite you code - and it has to be done by an expert. 90% of the mods in this forum are written very bad, yes that includes mods from "known people". At least this is the opinion of the expert i hired to rewrite my 4images installation. He also showed me some security issues on a fresh 4images installation with all the bugfixes installed (nicky,v@no - pm me for more information).

Again, this topic is not against 4images. Its about people who consider to have a big site based on 4images.
Everyone feel free to send me a PM if you have the same problems i had or for information about the changes.

Georgi
BULGARIA

edit on 31/01/2007
Well, this is my year graph - no comment ;)
Yes, this is after the changes i was talking about .


(average 2500 unique visits/100.000 hits per day)

On this first image you see a clear difference in the cpu average (green)
for November 2006 (before we make the changes) and January 2007 (after changes were made),
final steps are to get down the serverload (blue line).


(average 2500 unique visits/100.000 hits per day)

Picture above is the graph for January. You can clearly see the reduced cpu load (green),
even the average serverload (blue) is reduced by 20%.

At the end of February i hope we can reduce even this results by 40%, we'll see.





25
Discussion & Troubleshooting / Category permissions / Kategorie Rechte
« on: November 06, 2006, 10:41:23 PM »
Hi,

i tried finding some answers in the search but it didnt go well. So i need assistance.

For example i want to block 20 users from voting in a special category - how can i do that (even ith phpMyAdmin)
Please assist :)

Problem is, i have a "girl contest" on my site, and i want to forbid voting from the girls who are taking part in the contest. Thats maybe the only solution in theory,
but i don't know how to make it happen.

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

Hi,

Hab ueber die suchfunktion ne antwort zu finden, hat aber nicht hingehaut. Ich hoffe ihr koennt mir helfen.

Beispiel: Ich will 20 user-id's das voten in einer bestimmten kategorie nicht erlauben - wie kann ich das machen?
Die standart-einstellungen reichen mir nicht, da das voting auf "all" sein muss damit alle anderen (ausserr diesen 20) voten koennen.

Wie krieg ich das gebacken ?? :)

26
Chit Chat / 4images at uzipp hosting :/
« on: September 23, 2006, 10:22:52 PM »
Quote
All Accounts Must Obey The Following:

The Following Scripts Are Banned:
- CGI/Perl Based Forums
- YaBB CGI Version
- Topsites scripts
- Ikonboard (CGI)
- UltimateBB (CGI)
- 4Images
- Scripts VERY likely to eat up all of our CPU

http://www.uzipp.com/pages.php?id=aup

no comment ;)

27
Discussion & Troubleshooting / Override a setting in categories.php
« on: September 20, 2006, 03:42:17 PM »
Hi,

please help me on his one:

I dont want to have the paging option in the categories.php. For example,
when i open "categories.php?cat_id=777" i want to have ALL images to be shown, WITHOUT paging.

How do do that? I tried to alter my categories.php, but i din't get it to work.

Please help

28
Changed to *BETA*, since some users are expirience problems. I will re-check my code tomorrow,
it works for me, but maybe there are some other mod's required (i've installed to many and lost the view)



WHAT
Just for the beginning i would like to say, that this ADDON shows the 4 top-images uploaded by a user, who is currently logged in, displayed by:

- image with the best received rating
- image with the most views
- image with the most comments
- image with the most votes

For example, user "Bush" is loggin into your site, he has uploaded X images. This addon show's HIM HIS 4 best images
This ADDON is based on the "Mini Top MOD" by SSL, but you don't need to have it installed.

REQUIREMENTS
Not sure, but it should work even on a "naked" system. This ADDON is being tested only on a 4images 1.7.1 installation.

Let's go...

1. Create a file called mini_top_user.php with the following content:
Code: [Select]
<?php

define
('GET_CACHES'1);
define('ROOT_PATH''./');
$user_access get_permission();

$imgtable_width ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

 
$mini_top_user_images "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
 
$mini_top_user_images .= "<tr class=\"imagerow1\">\n";

 
$selection = array('rating''votes''hits''comments''downloads');
 
$selection_alt = array('votes DESC''rating DESC''name ASC''name ASC''name ASC');
 
$not_in_cat "4,6,288,234,7,319,1152"//list of categories which should not be included in top image, separated by coma (i.e. "1,2,3,7")
 #$selection_cutoff = array(' AND i.image_votes > 50', '', '', '', '');

 
$num_of_cells $config['image_cells'];
 
$num_of_cells $num_of_cells count($selection) ? count($selection) : $num_of_cells;

//echo $num_of_cells;

 
for ($cnt 0$cnt $num_of_cells$cnt++) {

 
$mini_top_user_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

#$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
#        FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
#        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
#        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN ($not_in_cat) ".$selection_cutoff[$cnt]."
# ORDER BY i.image_".$selection[$cnt]." DESC, i.image_".$selection_alt[$cnt]." LIMIT 0,1";

$sql "SELECT i.*".$additional_sql.", c.cat_name, u.user_name
        FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c, ".USERS_TABLE." u
        WHERE u.user_id = " 
$user_info['user_id'] . " AND u.user_id = i.user_id AND i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN ($not_in_cat) ".$selection_cutoff[$cnt]."
ORDER BY i.image_"
.$selection[$cnt]." DESC, i.image_".$selection_alt[$cnt]." LIMIT 0,1";

//AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").")

 
$result $site_db->query_firstrow($sql);
 
show_image($result);
 
$site_template->register_vars("lang_mini_top_mode"$lang['mini_top_'.$selection[$cnt]]);

 
$mini_top_user_images .= $site_template->parse_template("mini_top_user_bit");
 
$mini_top_user_images .= "\n</td>\n";
}

 
$mini_top_user_images .= "</tr>\n";
 
$mini_top_user_images .= "</table>\n";

 
$site_template->register_vars(array(
  
"mini_top_user_images" => $mini_top_user_images,
  
"lang_hits" => $lang['hits'],
  
"lang_downloads" => $lang['downloads'],
  
"lang_mini_top_title" => $lang['mini_top_title']
 ));
unset(
$mini_top_user_images);

?>




upload the file into your 4images home (where the index.php is)

2. Create a file called mini_top_user_bit.html with the following content:
Code: [Select]
<table cellpadding="0" cellspacing="0">

<tr>
<td width="110" height="120" valign="middle" align="center">
{lang_mini_top_mode}

{thumbnail}

</td>
</tr>
<td align="center">

{lang_rating}: <b>{image_rating}</b><BR>
{lang_votes}: <b>{image_votes}</b> <br />
{lang_hits}: <b>{image_hits}</b> <br />
{lang_comments}: <b>{image_comments}</b>


</td>
</tr>
</table>

save it and upload it into your current template folder (templates/yourtemplate/here)

3. Open /lang/your_language/main.php

add anywhere before the "?>" those lines:
Code: [Select]
$lang['mini_top_title'] = "Mini-Top";
$lang['mini_top_rating'] = "Most Rated";
$lang['mini_top_votes'] = "Most Voted";
$lang['mini_top_comments'] = "Most Commented";
$lang['mini_top_hits'] = "Most Viewed";

save it.

Inserting

It's quite easy. Just use include(ROOT_PATH.'mini_top_user.php'); in the php-file you want them to appear, and {mini_top_user_images} in the html-file.

Thats it :)

example

For example, you want to show them on the index.php - open it and find:
Code: [Select]
require(ROOT_PATH.'includes/sessions.php');

add below:
Code: [Select]
include(ROOT_PATH.'mini_top_user.php');

save it. Now open templates/your_template/home.html and use "{mini_top_user_images}" where you want the images to appear.


Hope i didn't forgot something, publishing stuff like this isn't my favorite part, but i want to share it.






29
A user oploaded some images, after that he asked me to delete his category.

But now the images (from the deleted folder) are still in "validate images", even if i delete them via FTP - how can i delete them?

30
english

Hi,

i'am making an "administration.php", something like the control panel, but more user friendly, and with your help i have almost finished it.

The next problem i'am on is:

How to show the last 4 images uploaded by the user, sorted by rating? Similar to the "New Images" on the main-page of 4images?
I know i have to use the code "Show New Images" in the index.php and alter it, but i don't have the neccessary knowledge to do it on my own.

Help would be nice :)

Thanks

deutsch

Ich habe eine neue *.php erstellt die mehr oder weniger das User Control Panel ersetzt. Dort will ich die letzten 4 bilder anzeigen lassen die der user hochgeladen hat. Ich bin mir sicher dass ich nur den "Show New Images" code von der index.php etwas aendern muss und ihn fuer meinen zweck benutzen kann, doch leider reichen meine php-kenntnisse nicht aus.

Wuerde mich freuen, wenn mir jemand helfen koennte :)
aehnlich wie in der index.php (halt in einer reihe).

Pages: 1 [2] 3 4 5