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 - PartyPix

Pages: [1] 2
1
Hi
this is my first MOD and I hope you will like this. I dont know whetter its perfect but on my page it gone. You can help me and make this code better or so.

Description / Beschreibung

Eng:
In this MOD you can allow your users to display the ZIP Code on the member_profile on the GERMAN map.

Ger:
In diesem MOD ist es möglich die PLZ (die der User bei der Registrierung eingibt) auf der deutschen Karte anzuzeigen.


Change files:

member.php
includes/db_field_definitions.php
includes/page_header.php
lang/deutsch/main.php
templates/default/register_form.html
templates/default/member_profile

New Folder:

templates/default/images/plz

1.)

open includes/db_field_definitions.php

add in the end just before ?> this code
Code: [Select]
$additional_user_fields['plz'] = array($lang['plz'], "text", 1);

2.)

open member.php

and after
Code: [Select]
if (!empty($user_row['user_email']) && (!isset($user_row['user_showemail']) || (isset($user_row['user_showemail']) && $user_row['user_showemail'] == 1))) {
      $user_email = $user_row['user_email'];
      $user_email_save = str_replace("@", " at ", $user_row['user_email']);
      if (!empty($url_mailform)) {
        $user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $user_row['user_id'], $url_mailform));
      }
      else {
        $user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&".URL_USER_ID."=".$user_row['user_id']);
      }
      $user_email_button = "<a href=\"".$user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$user_email_save."\" /></a>";
    }
    else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }

add this
Code: [Select]
// PLZ 2 Stellen
$max_string_laenge = 3;
if(strlen($user_row['plz'])>$max_string_laenge) $postleitzahl = substr($user_row['plz'],0,($max_string_laenge-1))."...";
else $postleitzahl = $user_row['plz'];


// PLZ 1 Stelle
$max_string_laenge = 2;
if(strlen($user_row['plz'])>$max_string_laenge) $postleitzahl_1 = substr($user_row['plz'],0,($max_string_laenge-1));
else $postleitzahl_1 = $user_row['plz'];


// PLZ Ende

find
Code: [Select]
$site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? format_text($user_row['user_name'], 2) : REPLACE_EMPTY,

and insert below
Code: [Select]
"postleitzahl" => $postleitzahl,
"postleitzahl_1" => $postleitzahl_1,


3.)
open templates/default/register_form.html

after
Code: [Select]
<tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1">
              <input type="text" name="user_email" size="30" class="input" value="{user_email}" />
            </td>
          </tr>
add this
Code: [Select]
<tr>
            <td class="row1"><b>{lang_plz}</b></td>
            <td class="row1">
              <input type="text"  maxlength="5" name="plz" class="input_register_plz" value="{plz}">
            </td>
          </tr>


4.)
open includes/page_header.php

find
Code: [Select]
$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],

and insert below
Code: [Select]
  "lang_plz" => $lang[plz],


5.)
open lang/deutsch/main.php

add at the end just before ?> this
Code: [Select]
$lang['plz'] = "PLZ";

6.)

open templates/member_profile.html

add after
Code: [Select]
<tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://www.icq.com/people/about_me.php?uin={user_icq}" target="_blank">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>

this
Code: [Select]
<tr>
          <td class="row1"><b>{lang_plz}</b></td>
          <td class="row1">{postleitzahl}</td>
        </tr>
 <tr>
          <td class="row1">&nbsp;</td>
          <td class="row1"><img src="{template_url}/images/plz/{postleitzahl_1}.png"></td>
        </tr>


7.)
Download the files , extract it in templates/default/images/plz


8.)
Upload all files you change and upload the new files,too.


9.)
go to your phpmyAdmin to the _user table and add 1 new field:

Name: plz
Typ: Varchar
Länge: 5
Standart: D

10.) Now finish. Register a new user and test it out.

I dont know whetter i have all here but i think so. I have test it on 4images 1.7.3 width a lot of MOD's like photo, bday, guestbook, pm, gender ....

Please help to make this better or something other. ;)

Greetz

2
Discussion & Troubleshooting / Additional Select
« on: October 29, 2006, 05:04:32 PM »
German:

Hi ich habe ein Problem. Undzwar habe ich mehrere Select's im register_form.html und member_editprofile.html. Speichern und so alles kein Problem. Aber wenn ich dann auf die editprofile seite gehe steht in der option immer das erste und nicht das gespeicherte. Wenn man dann zB irgendwas anderes ändert wird natürlich auch die Select neu geändert. Habe das dann versucht wie bei dem Birthday Mod ging zum speichern dann auch alles wunderbar nun aber im showprofile nicht. Helft mir bitte wie kann ich das lösen oder besser machen.

English:

Hi. I have many select's in register_form and editprofile. I can save the Select's but when i go on my editprofile site there is always the first option from the select and when i change anything others so automaticaly the first option from the select will change,too. I have try it in the way like the birthday mod and it gone but  only save and when i look in my showprofile there display not the right. Help me please or help me to make it better/other.

Grüße
/
Greetz

3
Discussion & Troubleshooting / What code ...
« on: May 30, 2006, 08:35:19 PM »
Hi
i have this code line in my session.php
Code: [Select]
$user_online_list .= "<option value=\"".$site_sess->url($user_profile_link)."\">".$username."".$invisibleuser."</option>";

Where must thís code:
Code: [Select]
<img src="templates/default/images/{sex}.gif" height="14">
place in the code to show the pic after the name ? And how must i change the code to make this possible ?

////////////

Hallo
ich habe folgende Codezeile in meiner session.php für die whos_online liste
Code: [Select]
$user_online_list .= "<option value=\"".$site_sess->url($user_profile_link)."\">".$username."".$invisibleuser."</option>";
Wo muss ich diesen Code (zum Anzeigen des Geschlechtes) 
Code: [Select]
<img src="templates/default/images/{sex}.gif" height="14">platzieren damit diese hinter dem Usernamen steht? Und wie muss das ganze dann aussehen ? Wäre um Hilfe echt dankbar !


4
Discussion & Troubleshooting / wrap ? automaticaly
« on: May 29, 2006, 06:06:32 PM »
Hi
i have one problem. In my profile I show the informations that in the DB save. I show it normaly so..

email:  maaaaaaaail@mail.de


My table has a width but dont make a automaticaly <br> when the entry is to long. Through that my design are destroyed. How can i make this better ? I háve allready look for wrap and so one in goofle and here but dont found a good information.




Hi.
Ich habe mal wieder ein Problem. Im Profil gebe ich ganz normal die Informationen aus. Nun habe ich einfach mal getestet was passiert wenn die mail sehr lang sein sollte. Er zeigt diese natürlich an aber dadurch wird mein ganzes Design zerstört. Den Tabellen habe ich auch eine Breite zugewiesen aber trotzdem kommt kein automatischer Umbruch. Habe schon überall nachgeschaut aber kam bisher zu keiner Lösung.


Here a little bit code of my member_profile.html / Hier ein kleiner Auszug aus meiner member_profile.html

Code: [Select]
<table cellspacing="2" cellpadding="8" border="0" width="390">
.
.
.
<table cellspacing="0" cellpadding="8" border="0" width="100%" >
<tr>
<td class=box_list_f><strong>e-Mail:</strong></td>
<td class=box_list>{user_email_save}&nbsp;</td>
</tr>
</table>

.
.
.
</rable>



5
Discussion & Troubleshooting / Can I delete the footer ... ?
« on: April 30, 2006, 12:52:29 PM »
Hi everyone.
I know that it is forbidden to delete the footer without a license.
But my question is:
Can I delete the Footer but for that i will link to 4homepages on the right part of my page. It is possible ?
It will be greate because it isnt nice to see on the top so much text (I have other text,too).

6
Chit Chat / Footer delete ?
« on: April 29, 2006, 01:23:15 AM »
Hi everyone.
I know that it is forbidden to delete the footer without a license.
But my question is:
Can I delete the Footer but for that i will link to 4homepages on the right part of my page. It is possible ?
It will be greate because it isnt nice to see on the top so much text (I have other text,too).

7
Discussion & Troubleshooting / include in index.php site template ?!
« on: April 28, 2006, 05:30:26 PM »
Hi
how can I include my news in the index.php to show that in the index.html ?

I have make this way but I dont know why it dont go.

index.php

Quote
$site_template->register_vars("news", include("templates/default/news/mynews.inc.php"));

index.html

Quote
{news}

But the news will be display in the top of the page and when I delete {news} it will be show, too. How can I make this better ???? What must I change ?


8
Language Packs / Translate me Please
« on: April 28, 2006, 12:57:34 PM »
Hi can anyone translate me the following 4 Links into a good German ?

a) Inbox
b) Sentbox
c) Outbox
d) New Message

Specific the Links b) & c) i will know because i think its the same ?!

PLEASE HELP ME ;)

9
Discussion & Troubleshooting / Splitt the editprofile page ?
« on: April 21, 2006, 12:16:50 PM »
Hey
how can I splitt my editprofile in more pages, like ICecream on his testgallery.
Here i have a screen.


10
Discussion & Troubleshooting / Register site on more pages
« on: April 21, 2006, 11:55:00 AM »
Hi
how can i make my register template on more pages ?
I mean that on the first page i ask for general option. When the user click on the Link (next to Step 2), I ask for detailed Information and on the last site i ask for the last information i need. Is that possble or not ? What must I change ?

greets

11
Discussion & Troubleshooting / Problem save in editprofile
« on: April 20, 2006, 02:07:24 AM »
Hi
I have change a lot in my editprofile and know I think the save button doesn't work ;( . If I click on it it will be no happened. I post my code here. Maybe you have a idee why i have the problem ?!

Code: [Select]

<TABLE cellpadding="0" cellspacing="0" align=center>
<TR>
<TD id="contentheader"> <B>></B>Einstellungen<B>< </B><br></TD>
</TR>
</TABLE>

<form method="post" action="{url_member}" enctype="multipart/form-data">

<TABLE width="400" border="0" cellspacing="0" cellpadding="4">

<TR>
<TD colspan="2" class="head1">Grundeinstellungen:</TD>
</TR>




<tr>
<td class="row1"><b>{lang_email}</b></td>
    <td class="row1"><input type="text" name="user_email"  size="30" value="{user_email}" class="input" /></td>
</tr>

<tr>
    <td class="row2"><b>{lang_email_confirm}</b></td>
    <td class="row2"><input type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></td>
</tr>

<tr>
<td class="row1" width="380"><b>{lang_show_email}</b></td>
<td class="row2" width="20"><input type="radio" name="user_showemail" value="1"{user_showemail_yes} />{lang_yes}&nbsp;&nbsp;&nbsp;
    <input type="radio" name="user_showemail" value="0"{user_showemail_no} />{lang_no}</td>
</tr>

<tr>
    <td class="row2" width="380"><b>{lang_allow_emails}</b></td>
    <td class="row2" width="20"><input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />{lang_yes}&nbsp;&nbsp;&nbsp;
    <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />{lang_no}</td>
</tr>

<tr>
    <td class="row2" width="380"><b>{lang_user_pm_email}</b></td>
    <td class="row2" width="20"><input type="radio" name="user_pm_email" value="1"{user_pm_email_yes} />{lang_yes}&nbsp;&nbsp;&nbsp;
    <input type="radio" name="user_pm_email" value="0"{user_pm_email_no} />{lang_no}</td>
</tr>

<tr>
    <td class="row2" width="380"><b>{lang_user_pm_popup}</b></td>
    <td class="row2" width="20"><input type="radio" name="user_pm_popup" value="1"{user_pm_popup_yes} />{lang_yes}&nbsp;&nbsp;&nbsp;
    <input type="radio" name="user_pm_popup" value="0"{user_pm_popup_no} />{lang_no}</td>
</tr>
<tr>
    <td class="row2" width="380"><b>{lang_invisible}</b></td>
    <td class="row2" width="20"><input type="radio" name="user_invisible" value="1"{user_invisible_yes} />{lang_yes}&nbsp;&nbsp;&nbsp;
    <input type="radio" name="user_invisible" value="0"{user_invisible_no} />{lang_no}</td>
</tr>

<tr>
<td colspan="2" class="head1"><br /></br />
Persönliche Informationen:
</td>
</tr>
<tr>
    <td class="row2"><b>{lang_firstname}</b></td>
    <td class="row2"><input type="text" name="firstname"  size="30" value="{firstname}" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_lastname}</b></td>
    <td class="row2"><input type="text" name="lastname"  size="30" value="{lastname}" class="input" /></td>
</tr>
<tr>
    <td class="row1"><b>{lang_birthday}</b></td>
    <td class="row1"><select name="user_birthday_day" class="dropdown">{birthday_day_options}</select>
    <select name="user_birthday_month" class="dropdown">{birthday_month_options}</select>&nbsp;<input class="input2" name="user_birthday_year" value="{user_birthday_year}" maxlength="4" size="5" type="text"></td>
    </tr>

<tr>
    <td class="row2"><b>{lang_plz}</b></td>
    <td class="row2"><input type="text" name="plz"  size="30" value="{plz}" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_ort}</b></td>
    <td class="row2"><input type="text" name="ort"  size="30" value="{ort}" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_homepage}</b></td>
    <td class="row2"><input type="text" name="user_homepage"  size="30" value="{user_homepage}" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_msn}</b></td>
    <td class="row2"><input type="text" name="msn"  size="30" value="{msn}" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_yahoo}</b></td>
    <td class="row2"><input type="text" name="yahoo"  size="30" value="{yahoo}" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_icq}</b></td>
    <td class="row2"><input type="text" name="user_icq"  size="30" value="{user_icq}" class="input" /></td>
</tr>

<form method="post" action="{url_member}">

<tr>
    <td colspan="2" class="head1"><b><br /></br />{lang_change_password}</b></td>
</tr>
<tr>
    <td class="row2"><b>{lang_old_password}</b></td>
    <td class="row2"><input type="password" name="current_user_password" size="30" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_new_password}</b></td>
    <td class="row2"><input type="password" name="user_password" size="30" class="input" /></td>
</tr>
<tr>
    <td class="row2"><b>{lang_new_password_confirm}</b></td>
    <td class="row2"><input type="password" name="user_password2" size="30" class="input" /></td>
</tr>
<tr>
<td class="row2">&nbsp;</td>
<td class="row2"><input type="hidden" name="action" value="updatepassword" />
<input type="submit" value="{lang_change_password}" class="button4" />&nbsp;
<input type="reset" value="{lang_reset}" class="button5" />
</td>
</tr>

</form>

{if userpic_allowed}
<tr>
    <td colspan="2" class="head1"><br /></br />Userbildeinstellungen:</td>
</tr>


<tr>
<td class="row2" align=top>{lang_userpic_upload}</td>
<td class="row2">
<INPUT type="file" name="userpic_file"  size="30" class="input" /><br /><br />{if userpic_img}<img src="{userpic_img}"><br />
<input type="checkbox" name="userpic_del" value="1">&nbsp;{lang_userpic_del}{endif userpic_img} </td>
</tr>

{endif userpic_allowed}

<tr>
<td class="row2">&nbsp;</td>
<td class="row2">
 <input type="hidden" name="action" value="updateprofile" />
 
    <input type="submit" value="{lang_save}" class="button" />
    <input type="reset" value="{lang_reset}" class="button" />
</td>
</tr>
</form>
</TABLE>

12
Chit Chat / Fehler in eurem Forum / Bug in your Forum
« on: April 20, 2006, 12:12:49 AM »
Hey
wolte euch nur mitteilen das wenn ich im Profil bin von jemanden und dann letzten Post ansehe, dass dann die ganze Seite ziehmlich vergrößert ist. (falls es noch nicht bemerkt wurde ;)

Hey
i want to tell you that you have a bug in your forum. If I'm in a profil of anyone and klick on last post, the site will be very big.
(if you don't know it ;)


greets

Party-Pix

13
Mods & Plugins (Requests & Discussions) / more register fields
« on: April 16, 2006, 11:04:19 PM »
Hey
how can i make more register options ? like birthday, state, male/female, timezone, and other ?
Give it a step for step tuturial for that ? It were be nice because I'm angry to change anything in the mysql & etc....

Hey
kann ich mehr Registeroptionen in meine register.html einfügen ?Wie zb. Geburtstag, Herkunft, Geschlecht, Zeitzone und andere Dinge.
Gibts es dafür eine Step für Step Anleitung? Weil ich habe echt Angst da irgendwas zu verbauen in der mysql Struktur und so...

MFG

PartyPix

14
Hallo
kann leider nicht so gut Englisch deshalb hoffe ich das auch Deutsch geht.
Ich habe ein Problem. Habe mir das PMS Sytsem installiert und es läuft auch ganz gut soweit.
Habe dann aber im Kontrollzenter bzw. in der member_editprofile.html einen Fehler feststellen müssen.
Wenn ich auf die Seite gehe sprich ins Kontrollzentrum, steht bei E-Mail folgendes: <a href=
Also das steht im input Feld. Den normalen von mir definierten Style wird auch nicht richtig angezeigt für dieses Input. Desweiteren steht hinter dem Input dieses hier: admin@yourdomain.com" class="input">
Das gleiche ist auch bei der Wiederholung der Emailadresse, sowie wenn ich im Homepage Feld eine Homepage eingebe und dann auf speichern drücke. Dann wird dieses so ähnlich angezeigt.
Der HTML Code ist meiner Meinung nach aber in Ordnung, habe ihn aber hier nochmal mit angehangen. Ich vermute das ein Fehler in meiner member.php sein muss deswegen hänge ich diese hier auch noch mit an. Sorry für den langen Code.

Ich hoffe mir kann jemand helfen.

member_editprofile.html
Code: [Select]
<IMG SRC="templates/default/navi/content_16.jpg" WIDTH="334" HEIGHT="20" BORDER="0" ALT=""><br><br>

<form method="post" action="{url_member}" enctype="multipart/form-data">
  <table width="350" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td valign="top" class="head1">
        <table width="350" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td colspan="2" valign="top" class="head1">{lang_profile_of} {user_name}</td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1"><input type="text" name="user_email"  size="30" value="{user_email}" class="input"></td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_email_confirm}</b></td>
            <td class="row2"><input type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_show_email}</b></td>
            <td class="row1">
              <input type="radio" name="user_showemail" value="1"{user_showemail_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_showemail" value="0"{user_showemail_no} />
              {lang_no}</td>
          </tr>
  <tr>
            <td class="row2"><b>{lang_allow_emails}</b></td>
            <td class="row2">
              <input type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}
</td>
          </tr>
  <tr>
            <td class="row2"><b>{lang_user_pm_email}</b></td>
            <td class="row2">
              <input type="radio" name="user_pm_email" value="1"{user_pm_email_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_pm_email" value="0"{user_pm_email_no} />
              {lang_no}
            </td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_user_pm_popup}</b></td>
            <td class="row1">
              <input type="radio" name="user_pm_popup" value="1"{user_pm_popup_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_pm_popup" value="0"{user_pm_popup_no} />
              {lang_no}
            </td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_invisible}</b></td>
            <td class="row1">
              <input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no}
</td>
          </tr>
          <tr>
            <td colspan="2" class="head1">{lang_optional_infos}</td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_homepage}</b></td>
            <td class="row1"><input type="text" name="user_homepage"  size="30" value="{user_homepage}" class="input" /></td>
          </tr><tr>
            <td class="row2"><b>{lang_icq}</b></td>
            <td class="row2"><input type="text" name="user_icq"  size="30" value="{user_icq}" class="input" /></td>
          </tr>
  {if userpic_allowed}
          <tr>
            <td class="row1" valign="top"><b>{lang_userpic}</b>
              <SPAN class="smalltext">
                <br /> <br /><br />
                <B>{lang_userpic_upload}</B>
              </SPAN>
            </td>
            <td class="row1">
              <INPUT type="file" name="userpic_file"  size="30" class="input" /><br /><br />
              {if userpic_img}<img src="{userpic_img}"><br /><input type="checkbox" name="userpic_del" value="1">&nbsp;{lang_userpic_del}{endif userpic_img}
            </TD>
          </TR>
{endif userpic_allowed}
         
        </table>
      </td>
    </tr>
  </table>
  <input type="hidden" name="action" value="updateprofile" />
  <p align="center">
    <input type="submit" value="{lang_save}" class="button" />
    <input type="reset" value="{lang_reset}" class="button" />
  </p>
</form>
<br />
<form method="post" action="{url_member}">
  <table width="350" border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td valign="top" class="head1">
        <table width="350" border="0" cellpadding="4" cellspacing="0">
          <tr>
            <td colspan="2" valign="top" class="head1">{lang_change_password}</td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_old_password}</b></td>
            <td class="row1"><input type="password" name="current_user_password" size="30" class="input" /></td>
          </tr>
          <tr>
            <td class="row2"><b>{lang_new_password}</b></td>
            <td class="row2"><input type="password" name="user_password" size="30" class="input" /></td>
          </tr>
          <tr>
            <td class="row1"><b>{lang_new_password_confirm}</b></td>
            <td class="row1"><input type="password" name="user_password2" size="30" class="input" /></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <input type="hidden" name="action" value="updatepassword" />
  <p align="center">
    <input type="submit" value="{lang_change_password}" class="button" />
    <input type="reset" value="{lang_reset}" class="button" />
  </p>
</form>

member.php (Wurde leider gekürzt, hoffe das reicht aber soweit.)
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: member.php                                           *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.2                                                *
 *                                                                        *
 *    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 "member";

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

if (
$action == "") {
  $action "lostpassword";
}
$content "";
$txt_clickstream "";

$sendprocess 0;

if (isset(
$HTTP_GET_VARS[URL_COMMENT_ID]) || isset($HTTP_POST_VARS[URL_COMMENT_ID])) {
  $comment_id = (isset($HTTP_GET_VARS[URL_COMMENT_ID])) ? intval($HTTP_GET_VARS[URL_COMMENT_ID]) : intval($HTTP_POST_VARS[URL_COMMENT_ID]);
}
else {
  $comment_id 0;
}

if (
$action == "deletecomment") {
  if (!$comment_id || ($config['user_delete_comments'] != && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $sql "SELECT c.comment_id, c.user_id AS comment_user_id, i.image_id, i.cat_id, i.user_id, i.image_name
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  $comment_row $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['comment_delete'];

  $sql "UPDATE ".IMAGES_TABLE."
          SET image_comments = image_comments - 1
          WHERE image_id = "
.$comment_row['image_id'];
  $site_db->query($sql);

  if ($comment_row['comment_user_id'] != GUEST) {
    $sql "UPDATE ".USERS_TABLE."
            SET "
.get_user_table_field("""user_comments")." = ".get_user_table_field("""user_comments")." - 1
            WHERE "
.get_user_table_field("""user_id")." = ".$comment_row['comment_user_id'];
    $site_db->query($sql);
  }

  $sql "DELETE FROM ".COMMENTS_TABLE."
          WHERE comment_id = 
$comment_id";
  $result $site_db->query($sql);
  $msg = ($result) ? $lang['comment_delete_success'] : $lang['comment_delete_error'];
}

if (
$action == "removecomment") {
  if (!$comment_id || ($config['user_delete_comments'] != && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $sql "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  $comment_row $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['comment_delete'];

  if (isset($comment_row[$user_table_fields['user_name']]) && $comment_row['comment_user_id'] != GUEST) {
    $user_name $comment_row[$user_table_fields['user_name']];
  }
  else {
    $user_name $comment_row['comment_user_name'];
  }

  $site_template->register_vars(array(
    "comment_id" => $comment_id,
    "image_name" => format_text($comment_row['image_name']),
    "user_name" => format_text($user_name),
    "comment_headline" => format_text($comment_row['comment_headline'], 0$config['wordwrap_comments'], 00),
    "comment_text" => format_text($comment_row['comment_text'], $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments']),
    "lang_delete_comment" => $lang['comment_delete'],
    "lang_delete_comment_confirm" => $lang['comment_delete_confirm'],
    "lang_image_name" => $lang['image_name'],
    "lang_name" => $lang['name'],
    "lang_headline" => $lang['headline'],
    "lang_comment" => $lang['comment'],
    "lang_submit" => $lang['submit'],
    "lang_reset" => $lang['reset'],
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']
  ));
  $content $site_template->parse_template("member_deletecomment");
}

if (
$action == "updatecomment") {
  if (!$comment_id || ($config['user_edit_comments'] != && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $sql "SELECT c.comment_id, c.image_id, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  $comment_row $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['comment_edit'];

  $error 0;

  $comment_headline un_htmlspecialchars(trim($HTTP_POST_VARS['comment_headline']));
  $comment_text un_htmlspecialchars(trim($HTTP_POST_VARS['comment_text']));

  if ($comment_headline == "")  {
    $error 1;
    $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['headline']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  if ($comment_text == "")  {
    $error 1;
    $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['comment']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" "").$field_error;
  }

  if (!$error) {
    $sql "UPDATE ".COMMENTS_TABLE."
            SET comment_headline = '
$comment_headline', comment_text = '$comment_text'
            WHERE comment_id = 
$comment_id";
    $result $site_db->query($sql);
    $msg = ($result) ? $lang['comment_edit_success'] : $lang['comment_edit_error'];
  }
  else {
    $action "editcomment";
    $sendprocess 1;
  }
}

if (
$action == "editcomment") {
  if (!$comment_id || ($config['user_edit_comments'] != && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $sql "SELECT c.comment_id, c.image_id, c.user_id AS comment_user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, i.image_name, i.cat_id, i.user_id".get_user_table_field(", u.""user_name")."
          FROM ("
.COMMENTS_TABLE." c, ".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = c.user_id)
          WHERE c.comment_id = 
$comment_id AND i.image_id = c.image_id";
  $comment_row $site_db->query_firstrow($sql);
  if (!$comment_row || $comment_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $comment_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    header("Location: ".$site_sess->url($url"&"));
    exit;
  }

  $txt_clickstream get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".format_text($comment_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['comment_edit'];

  $comment_headline = (isset($HTTP_POST_VARS['comment_headline'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_headline']))) : $comment_row['comment_headline'];
  $comment_text = (isset($HTTP_POST_VARS['comment_text'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['comment_text']))) : $comment_row['comment_text'];

  if (isset($comment_row[$user_table_fields['user_name']]) && $comment_row['comment_user_id'] != GUEST) {
    $user_name $comment_row[$user_table_fields['user_name']];
  }
  else {
    $user_name $comment_row['comment_user_name'];
  }

  $bbcode "";
  if ($config['bb_comments'] == 1) {
    $site_template->register_vars(array(
      "lang_bbcode" => $lang['bbcode'],
      "lang_tag_prompt" => $lang['tag_prompt'],
      "lang_link_text_prompt" => $lang['link_text_prompt'],
      "lang_link_url_prompt" => $lang['link_url_prompt'],
      "lang_link_email_prompt" => $lang['link_email_prompt'],
      "lang_list_type_prompt" => $lang['list_type_prompt'],
      "lang_list_item_prompt" => $lang['list_item_prompt']
    ));
    $bbcode $site_template->parse_template("bbcode");
  }

  $site_template->register_vars(array(
    "bbcode" => $bbcode,
    "comment_id" => $comment_id,
    "image_name" => format_text($comment_row['image_name']),
    "user_name" => format_text($user_name),
    "comment_headline" => format_text($comment_headline2),
    "comment_text" => format_text($comment_text2),
    "lang_edit_comment" => $lang['comment_edit'],
    "lang_image_name" => $lang['image_name'],
    "lang_name" => $lang['name'],
    "lang_headline" => $lang['headline'],
    "lang_comment" => $lang['comment'],
    "lang_submit" => $lang['submit'],
    "lang_reset" => $lang['reset'],
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']
  ));
  $content $site_template->parse_template("member_editcomment");
}

if (
$action == "deleteimage") {
  if (!$image_id || ($config['user_delete_image'] != && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }
  $sql "SELECT image_id, cat_id, user_id, image_name, image_media_file, image_thumb_file
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  $image_row $site_db->query_firstrow($sql);
  if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream $lang['image_delete'];

  $sql "DELETE FROM ".IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  $del_img $site_db->query($sql);

  if (!is_remote($image_row['image_media_file']) && !is_local_file($image_row['image_media_file'])) {
    @unlink(MEDIA_PATH."/".$image_row['cat_id']."/".$image_row['image_media_file']);
  }
  if (!empty($image_row['image_thumb_file']) && !is_remote($image_row['image_thumb_file']) && !is_local_file($image_row['image_thumb_file'])) {
    @unlink(THUMB_PATH."/".$image_row['cat_id']."/".$image_row['image_thumb_file']);
  }

  include(ROOT_PATH.'includes/search_utils.php');
  remove_searchwords($image_id);

  if (!empty($user_table_fields['user_comments'])) {
    $sql "SELECT user_id
            FROM "
.COMMENTS_TABLE."
            WHERE image_id = 
$image_id";
    $result $site_db->query($sql);
    $user_id_sql "";
    while ($row $site_db->fetch_array($result)) {
      if ($row['user_id'] != GUEST) {
        $sql "UPDATE ".USERS_TABLE."
                SET "
.get_user_table_field("""user_comments")." = ".get_user_table_field("""user_comments")." - 1
                WHERE "
.get_user_table_field("""user_id")." = ".$row['user_id'];
        $site_db->query($sql);
      }
    }
  }

  $sql "DELETE FROM ".COMMENTS_TABLE."
          WHERE image_id = 
$image_id";
  $del_com $site_db->query($sql);

  if ($del_img) {
    $msg $lang['image_delete_success'];
  }
  else {
    $msg $lang['image_delete_error'];
  }
}

if (
$action == "removeimage") {
  if (!$image_id || ($config['user_delete_image'] != && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }
  $sql "SELECT image_id, cat_id, user_id, image_name
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  $image_row $site_db->query_firstrow($sql);
  if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".format_text($image_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['image_delete'];

  $site_template->register_vars(array(
    "image_id" => $image_id,
    "image_name" => format_text($image_row['image_name']),
    "lang_delete_image" => $lang['image_delete'],
    "lang_delete_image_confirm" => $lang['image_delete_confirm'],
    "lang_submit" => $lang['submit'],
    "lang_reset" => $lang['reset'],
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']
  ));
  $content $site_template->parse_template("member_deleteimage");
}

if (
$action == "updateimage") {
  if (!$image_id || ($config['user_edit_image'] != && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
  }
  $sql "SELECT image_id, cat_id, user_id, image_name
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  $image_row $site_db->query_firstrow($sql);
  if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    show_error_page($lang['no_permission']);
    exit;
  }

  $txt_clickstream get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".format_text($image_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['image_edit'];

  $error 0;

  $image_name un_htmlspecialchars(trim($HTTP_POST_VARS['image_name']));
  $image_description un_htmlspecialchars(trim($HTTP_POST_VARS['image_description']));
  $image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
  $image_keywords preg_replace("/[\n\r]/is"" "$image_keywords);
  $image_keywords str_replace(","," ",$image_keywords);
  $image_keywords ereg_replace("( ){2,}"" "$image_keywords);

  if ($image_name == "")  {
    $error 1;
    $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['image_name']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" "").$field_error;
  }

  if (!empty($additional_image_fields)) {
    foreach ($additional_image_fields as $key => $val) {
      if (isset($HTTP_POST_VARS[$key]) && intval($val[2]) == && trim($HTTP_POST_VARS[$key]) == "") {
        $error 1;
        $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$val[0]), $lang['field_required']);
        $msg .= (($msg != "") ? "<br />" "").$field_error;
      }
    }
  }

  if (!$error) {
    $additional_sql "";

    if (isset($HTTP_POST_VARS['image_allow_comments'])) {
      $additional_sql .= ", image_allow_comments = ".intval($HTTP_POST_VARS['image_allow_comments']);
    }

    if (!empty($additional_image_fields)) {
      $table_fields $site_db->get_table_fields(IMAGES_TABLE);
      foreach ($additional_image_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }

    $sql "UPDATE ".IMAGES_TABLE."
            SET image_name = '
$image_name', image_description = '$image_description', image_keywords = '$image_keywords'".$additional_sql."
            WHERE image_id = 
$image_id";
    $result $site_db->query($sql);
    if ($result) {
      include(ROOT_PATH.'includes/search_utils.php');
      $search_words = array();
      foreach ($search_match_fields as $image_column => $match_column) {
        if (isset($HTTP_POST_VARS[$image_column])) {
          $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);
        }
      }
      remove_searchwords($image_id);
      add_searchwords($image_id$search_words);
      $msg $lang['image_edit_success'];
    }
    else {
      $msg $lang['image_edit_error'];
    }
  }
  else {
    $action "editimage";
    $sendprocess 1;
  }
}

if (
$action == "editimage") {
  if (!$image_id || ($config['user_edit_image'] != && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $additional_sql "";
  if (!empty($additional_image_fields)) {
    foreach ($additional_image_fields as $key => $val) {
      $additional_sql .= ", ".$key;
    }
  }
  $sql "SELECT image_id, cat_id, user_id, image_name, image_description, image_keywords, image_allow_comments".$additional_sql."
          FROM "
.IMAGES_TABLE."
          WHERE image_id = 
$image_id";
  $image_row $site_db->query_firstrow($sql);
  if (!$image_row || $image_row['user_id'] <= USER_AWAITING || ($user_info['user_id'] != $image_row['user_id'] && $user_info['user_level'] != ADMIN)) {
    redirect($url);
  }

  $txt_clickstream get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".format_text($image_row['image_name'])."</a>".$config['category_separator'];
  $txt_clickstream .= $lang['image_edit'];

  $image_name = (isset($HTTP_POST_VARS['image_name'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['image_name']))) : $image_row['image_name'];
  $image_description = (isset($HTTP_POST_VARS['image_description'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['image_description']))) : $image_row['image_description'];
  $image_keywords = (isset($HTTP_POST_VARS['image_keywords'])) ? un_htmlspecialchars(stripslashes(trim($HTTP_POST_VARS['image_keywords']))) : $image_row['image_keywords'];
  $image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments'])) ? intval($HTTP_POST_VARS['image_allow_comments']) : $image_row['image_allow_comments'];

  $site_template->register_vars(array(
    "image_id" => $image_id,
    "image_name" => format_text($image_name2),
    "image_description" => format_text($image_description2),
    "image_keywords" => format_text($image_keywords2),
    "image_allow_comments_yes" => ($image_allow_comments) ? " checked=\"checked\"" "",
    "image_allow_comments_no" => (!$image_allow_comments) ? " checked=\"checked\"" "",
    "lang_edit_image" => $lang['image_edit'],
    "lang_image_name" => $lang['image_name'],
    "lang_description" => $lang['description'],
    "lang_keywords" => $lang['keywords_ext'],
    "lang_allow_comments" => isset($lang['allow_comments']) ? $lang['allow_comments'] : "",
    "lang_submit" => $lang['submit'],
    "lang_reset" => $lang['reset'],
    "lang_yes" => $lang['yes'],
    "lang_no" => $lang['no']
  ));

  if (!empty($additional_image_fields)) {
    $additional_field_array = array();
    foreach ($additional_image_fields as $key => $val) {
      if ($val[1] == "radio") {
        $value = (isset($HTTP_POST_VARS[$key])) ? intval($HTTP_POST_VARS[$key]) : $image_row[$key];
        if ($value == 1) {
          $additional_field_array[$key.'_yes'] = " checked=\"checked\"";
          $additional_field_array[$key.'_no'] = "";
        }
        else {
          $additional_field_array[$key.'_yes'] = "";
          $additional_field_array[$key.'_no'] = " checked=\"checked\"";
        }
      }
      else {
        $value = (isset($HTTP_POST_VARS[$key])) ? format_text(stripslashes(trim($HTTP_POST_VARS[$key]))) : $image_row[$key];
      }
      $additional_field_array[$key] = $value;
      $additional_field_array['lang_'.$key] = $val[0];
    }
    if (!empty($additional_field_array)) {
      $site_template->register_vars($additional_field_array);
    }
  }
  $content $site_template->parse_template("member_editimage");
}

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

  $txt_clickstream "";
  if ($cat_id && isset($cat_cache[$cat_id])) {
    $txt_clickstream .= get_category_path($cat_id1).$config['category_separator'];
  }
  $txt_clickstream .= $lang['user_upload'];

  $remote_media_file format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_media_file'])));
  $remote_thumb_file format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['remote_thumb_file'])));

  $image_name un_htmlspecialchars(trim($HTTP_POST_VARS['image_name']));
  $image_description un_htmlspecialchars(trim($HTTP_POST_VARS['image_description']));
  $image_keywords un_htmlspecialchars(trim($HTTP_POST_VARS['image_keywords']));
  $image_keywords preg_replace("/[\n\r]/is"" "$image_keywords);
  $image_keywords str_replace(","," ",$image_keywords);
  $image_keywords ereg_replace("( ){2,}"" "$image_keywords);

  $image_active = (isset($HTTP_POST_VARS['image_active']) && $HTTP_POST_VARS['image_active'] == 0) ? 1;
  $image_allow_comments = (isset($HTTP_POST_VARS['image_allow_comments']) && $HTTP_POST_VARS['image_allow_comments'] == 0) ? 1;
  $image_download_url = (isset($HTTP_POST_VARS['image_download_url'])) ? format_url(un_htmlspecialchars(trim($HTTP_POST_VARS['image_download_url']))) : "";

  $direct_upload = (check_permission("auth_directupload"$cat_id)) ? 0;
  $upload_cat = ($direct_upload) ? $cat_id 0;

  $error 0;
  $uploaderror 0;

  if ($cat_id == 0)  {
    $error 1;
    $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['category']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" "").$field_error;
  }
  if ((empty($HTTP_POST_FILES['media_file']['tmp_name']) || $HTTP_POST_FILES['media_file']['tmp_name'] == "none") && ($remote_media_file == "" || !check_remote_media($remote_media_file))) {
    $error 1;
    $msg .= (($msg != "") ? "<br />" "").$lang['image_file_required'];
  }
  if ($image_name == "")  {
    $error 1;
    $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$lang['image_name']), $lang['field_required']);
    $msg .= (($msg != "") ? "<br />" "").$field_error;
  }

  if (!empty($additional_image_fields)) {
    foreach ($additional_image_fields as $key => $val) {
      if (isset($HTTP_POST_VARS[$key]) && intval($val[2]) == && trim($HTTP_POST_VARS[$key]) == "") {
        $error 1;
        $field_error preg_replace("/".$site_template->start."field_name".$site_template->end."/siU"str_replace(":"""$val[0]), $lang['field_required']);
        $msg .= (($msg != "") ? "<br />" "").$field_error;
      }
    }
  }

  if (!$error) {
    // Start Upload
    include(ROOT_PATH.'includes/upload.php');
    $site_upload = new Upload();

    // Upload Media file
    if (!empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none") {
      $new_name $site_upload->upload_file("media_file""media"$upload_cat);
      if (!$new_name) {
        $msg .= (($msg != "") ? "<br />" "")."<b>".$lang['file_upload_error'].": ".$new_name."</b><br />".$site_upload->get_upload_errors();
        $uploaderror 1;
      }
    }
    else {
      $new_name $remote_media_file;
    }

    // Uplad thumb file
    $new_thumb_name "";
    if (!empty($HTTP_POST_FILES['thumb_file']['tmp_name']) && $HTTP_POST_FILES['thumb_file']['tmp_name'] != "none" && !$uploaderror) {
      $new_thumb_name $site_upload->upload_file("thumb_file""thumb"$upload_catbasename($new_name));
      if (!$new_thumb_name) {
        $msg .= (($msg != "") ? "<br />" "")."<b>".$lang['thumb_upload_error'].": ".$new_thumb_name."</b><br />".$site_upload->get_upload_errors();
        @unlink(MEDIA_TEMP_PATH."/".$new_name);
        $uploaderror 1;
      }
    }
    elseif (check_remote_thumb($remote_thumb_file)) {
      $new_thumb_name $remote_thumb_file;
    }
    elseif ($config['auto_thumbnail'] == && !empty($HTTP_POST_FILES['media_file']['tmp_name']) && $HTTP_POST_FILES['media_file']['tmp_name'] != "none" && !$uploaderror) {
      if ($direct_upload) {
        $src MEDIA_PATH."/".$cat_id."/".$new_name;
        $dest THUMB_PATH."/".$cat_id."/".$new_name;
      }
      else {
        $src MEDIA_TEMP_PATH."/".$new_name;
        $dest THUMB_TEMP_PATH."/".$new_name;
      }
      $do_create 0;
      if ($image_info = @getimagesize($src)) {
        if ($image_info[2] == || $image_info[2] == || $image_info[2] == 3) {
          $do_create 1;
        }
      }
      if ($do_create) {
        require(ROOT_PATH.'includes/image_utils.php');
        $convert_options init_convert_options();
        if (!$convert_options['convert_error']) {
          $dimension = (intval($config['auto_thumbnail_dimension'])) ? intval($config['auto_thumbnail_dimension']) : 100;
          $resize_type = (intval($config['auto_thumbnail_resize_type'])) ? intval($config['auto_thumbnail_resize_type']) : 1;
          $quality = (intval($config['auto_thumbnail_quality']) && intval($config['auto_thumbnail_quality']) <= 100) ? intval($config['auto_thumbnail_quality']) : 100;

          if (create_thumbnail($src$dest$quality$dimension$resize_type)) {
            $new_thumb_name $new_name;
          }
        }
      }
    }

    if (!$uploaderror) {
      $additional_field_sql "";
      $additional_value_sql "";
      if (!empty($additional_image_fields)) {
        $table = ($direct_upload) ? IMAGES_TABLE IMAGES_TEMP_TABLE;
        $table_fields $site_db->get_table_fields($table);
        foreach ($additional_image_fields as $key => $val) {
          if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
            $additional_field_sql .= ", $key";
            $additional_value_sql .= ", '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
          }
        }
      }

      $current_time time();
      if ($direct_upload) {
        $sql "INSERT INTO ".IMAGES_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments"
.$additional_field_sql.")
                VALUES
                (
$cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time$image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
        $result $site_db->query($sql);
        $image_id $site_db->get_insert_id();
        if ($result) {
          include(ROOT_PATH.'includes/search_utils.php');
          $search_words = array();
          foreach ($search_match_fields as $image_column => $match_column) {
            if (isset($HTTP_POST_VARS[$image_column])) {
              $search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);
            }
          }
          add_searchwords($image_id$search_words);
        }
      }
      else {
        $sql "INSERT INTO ".IMAGES_TEMP_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url"
.$additional_field_sql.")
                VALUES
                (
$cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
        $result $site_db->query($sql);
      }

      if ($config['upload_notify'] == && !$direct_upload) {
        include(ROOT_PATH.'includes/email.php');
        $site_email = new Email();

        $config['upload_emails'] = str_replace(" """$config['upload_emails']);
        $emails explode(","$config['upload_emails']);

        $validation_url $script_url."/admin/index.php?goto=".urlencode("validateimages.php?action=validateimages");

        $site_email->set_to($config['site_email']);
        $site_email->set_subject($lang['new_upload_emailsubject']);
        $site_email->register_vars(array(
          "image_name" => stripslashes($image_name),
          "file_name" => $new_name,
          "cat_name" => $cat_cache[$cat_id]['cat_name'],
          "validation_url" => $validation_url,
          "site_name" => $config['site_name']
        ));
        $site_email->set_body("upload_notify"$config['language_dir_default']);
        $site_email->set_bcc($emails);
        $site_email->send_email();
      }

      $msg .= $lang['image_add_success'].": <b>".format_text(stripslashes($image_name))."</b> (".$new_name.")";
      $msg .= (!$direct_upload) ? "<br />".$lang['new_upload_validate_desc'] : "";

      $file_extension get_file_extension($new_name);
      $file = (is_remote($new_name)) ? $new_name : (($direct_upload) ? MEDIA_PATH."/".$cat_id."/".$new_name MEDIA_TEMP_PATH."/".$new_name);
      $width_height "";
      if (!is_remote($file) && $imageinfo = @getimagesize($file)) {
        $width_height " ".$imageinfo[3];
      }
      $media_icon "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
      $site_template->register_vars(array(
        "media_src" => $file,
        "media_icon" => $media_icon,
        "image_name" => format_text(stripslashes($image_name)),
        "width_height" => $width_height
      
));
      $media $site_template->parse_template("media/".$file_extension);
      $content .= "<table border=\"0\" align=\"center\">\n<tr>\n<td>\n".$media."\n</td>\n</tr>\n</table>\n";
    }
    else {
      $action "uploadform";
      $sendprocess 1;
    }
  }
  else

15
Mods & Plugins (Requests & Discussions) / Memberlist
« on: January 05, 2006, 05:08:35 PM »
Hallo
ich wollte mal fragen wie ich meine Member alle auf einer Seite anzeigen kann ? ( auch für unregistrierte User zu sehen )
Habe auch dieses MOD, welches es hier gibt ausprobiert, aber leider gabs dort Fehler. (irgendwelche Datenbank Fehler).
Kann mir vielleicht jemand das auf meienr Seite installieren ?
Wäre echt nett

Kontakt:
Forum oder per MSN / ICQ: marcel_waldau@hotmail.com / 260813480

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Hello
I want to ask how i display all my members on a site (for unregisted User,too)
I habe this mod which it give on this site try out but it gave where any problems with the Database.
Is here anyone who can install me a memberlist on my page ?
Would be genuinly nice

Contact:
Forum or MSN / ICQ: marcel_waldau@hotmail.com / 260813480


Pages: [1] 2