Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
PhotoUpload in usercp with template use ! Details »»
PhotoUpload in usercp with template use !
Version: , by bommelchen bommelchen is offline
Developer Last Online: Dec 2002 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-27-2002 Last Update: Never Installs: 0
 
No support by the author.

Hello @all,
I have integrated the PhotoUpload Hack in the UserCP and its work but i have a Problem with my reselution. The Error handling !!!

I search for a resolution to display the ErrorMessages in the Template.

here are my File Changes in Upload.php
search for this:
PHP Code:
require($DOCUMENT_ROOT "/vb/global.php"); 
and replace with this:
PHP Code:
$templatesused 'usercpnav,photoupload_main,photoupload_redirect_update';
require(
"./global.php");

    
$cpnav = array();
    
$cpmenu = array();


  
$cpnav[1]="#1C5780";
  
$cpnav[2]="#1C5780";
  
$cpnav[3]="#1C5780";
  
$cpnav[4]="#1C5780";
  
$cpnav[5]="#1C5780";
  
$cpnav[6]="#1C5780";
  
$cpnav[7]="#1C5780";
  
$cpnav[8]="#13486D";
  
$cpmenu[8]="class=\"fjsel\" selected";

  eval(
"\$cpnav = \"".gettemplate("usercpnav")."\";"); 
now search for this:
PHP Code:
    echo"<html><head><title>$username's Picture Upload Utility</title></head></html>";
    echo
"<TABLE cellSpacing=0 width=\"100%\" align=center border=0 bordercolordark=\"#000000\" cellpadding=\"0\">";
    echo
"<TBODY><tr><TD bgColor=#000000><TABLE align=center bgColor=#FFFFFF border=1 cellPadding=0 cellSpacing=0 width=\"100%\" bordercolor=\"#FFFFFF\" bordercolorlight=\"#FFFFFF\" bordercolordark=\"#FFFFFF\">";
    echo
"<TBODY><TR vAlign=top><TD vAlign=top align=middle><TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width=\"100%\" bgColor=#ffffff borderColorLight=#000000 border=1 height=\"188\"></TABLE>";
    echo
"<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"\0\" height=\"17\" bordercolorlight=\"#000000\" bordercolor=\"#000000\" bordercolordark=\"$headcolor\" bgcolor=\"$headcolor\"><tr>";
    echo
"<TD bgcolor=\"$headcolor\" bordercolor=\"$headcolor\" bordercolorlight=\"$headcolor\" bordercolordark=\"$headcolor\" height=17><table border=0 width=100% cellspacing=0 cellpadding=0><tr><td width=33%><b><font face=\"$font\" color=\"$headcolortext\" size=$smallerfontsize>&nbsp;Photo Upload Information</font></b></td><td width=64%></td><td width=3%><a href=$cpurl/usercp.php?><img border=0 src=images/upload_files/profile.gif width=15 height=14 alt=\"Click here to view your profile control panel.\"></a>&nbsp;&nbsp;<a href=userhelp.htm onclick=\"window.open(this.href,'name','225','225','yes');return false\"><img border=0 src=images/upload_files/question.jpg width=18 height=19 alt=\"Click here to view a user manual, if you are not for sure about something.\"></a></td></tr></table>";
    echo
"</tr></table><TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width=\"100%\" bgColor=#ffffff borderColorLight=#000000 border=1><tr><td><table class=\"reg\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\"><tr><td>";
    echo
"<font face=\"$font\" size=\"$smallerfontsize\">$welcome</font>";
    echo
"</td></tr><tr vAlign=\"top\"><font face=\"$font\" size=\"$largerfontsize\"><td></font></td></tr></table></td>";
    echo
"</tr></TABLE><br><table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" height=\"17\" bordercolorlight=\"#000000\" bordercolor=\"#000000\" bordercolordark=\"$headcolor\" bgcolor=\"$headcolor\">";
    echo
"<tr><TD bgcolor=\"$headcolor\" bordercolor=\"$headcolor\" bordercolorlight=\"$headcolor\" height=\"17\"><b><font color=\"#FFFFFF\" face=\"$font\" size=\"$smallerfontsize\">&nbsp;Photo Upload</font></b></TD></tr></table>";
    echo
"<TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width=\"100%\" bgColor=#ffffff borderColorLight=#000000 border=1><tr><td><table class=\"reg\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\"><tr><td><table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#FFFFFF\">";
    echo
"<tr><td width=\"50%\" bgcolor=\"$headcolor\" bordercolor=\"$headcolor\" bordercolorlight=\"$headcolor\" bordercolordark=\"#000000\"><font face=\"$font\" size=\"$largerfontsize\"><b>&nbsp;<font color=\"#FFFFFF\">Photo Information</font></b></font></td>";
    echo
"<td width=\"50%\" bgcolor=\"$headcolor\" bordercolor=\"$headcolor\" bordercolorlight=\"$headcolor\" bordercolordark=\"#000000\"><font face=\"$font\" size=\"$largerfontsize\"><b>&nbsp;<font color=\"#FFFFFF\">Upload Form</font></b></font></td></tr><tr><td width=\"50%\" bordercolor=\"#000000\" valign=\"top\"><p align=\"center\"><br>" $Warning "<br><br>" $the_void "<br><br>" $rambo "</td><td width=\"50%\" bordercolor=\"#000000\" valign=\"top\">";
    echo
"<table border=\"1\" width=\"100%\" cellpadding=\"5\"><tr><td width=\"100%\" valign=\"top\" bordercolor=\"#000000\">";
    echo
"<form ENCTYPE=\"multipart/form-data\"  method=\"post\"><font face=\"$font\" size=\"$smallerfontsize\" color=\"$headcolor\">Upload a Photo</font><br>";
    echo
"<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2000000\">";
    echo
"<input type=\"File\" name=\"picture\" size=\"40\" maxlength=\"80\"><br>";
    echo
"<font face=\"$font\" size=\"$smallerfontsize\" color=\"$headcolor\">Photo Description</font><br><TEXTAREA Rows=\"10\" COLS=\"30\" NAME=\"photodesc\"></TEXTAREA>   <input type=\"submit\" name=\"update_desc\" value=\"Description\"><br>";
    echo
"<input type=\"submit\" name=\"submit\" value=\"Upload\">  <input type=\"submit\" name=\"del_pic\" value=\"Delete\"></form>";
    echo
"</td></tr><tr><td width=\"100%\" valign=\"top\" bordercolor=\"#000000\"><font face=\"$font\" size=\"$smallerfontsize\" color=\"#000000\">Your Current File Is :</font><font face=\"$font\" size=\"$smallerfontsize\" color=\"$infocolor\"> $alphabravo</font><br><br><font face=\"$font\" size=\"$smallerfontsize\" color=\"#000000\">Photo Description :</font><font face=\"$font\" size=\"$smallerfontsize\" color=\"$infocolor\"> $spillthebeans</font><br><font face=\"$font\" size=\"$smallerfontsize\" color=\"#000000\">Last Updated :</font><font face=\"$font\" size=\"$smallerfontsize\" color=\"$infocolor\"> $pic_lastupdated&nbsp;@&nbsp;$time4lastupdate</font>";
    echo
"</td></tr></table></td></tr></table></td></tr><tr vAlign=\"top\"><font face=\"$font\" size=\"$largerfontsize\"><td>";
    echo
"</font></td></tr></table></td></tr></TABLE></table></table>";
    echo
"<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"\0\" height=\"17\" bordercolorlight=\"#000000\" bordercolor=\"#000000\" bordercolordark=\"$headcolor\" bgcolor=\"$headcolor\"><tr><TD bgcolor=\"$headcolor\" bordercolor=\"$headcolor\" bordercolorlight=\"$headcolor\" height=\"17\"><b><font color=\"#FFFFFF\" face=\"$font\" size=\"$smallerfontsize\">&nbsp;Error Messages:</font></b>";
    echo
"</TD></tr></table><TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff cellPadding=5 width=\"100%\" bgColor=#ffffff borderColorLight=#000000 border=1><tr><td><table class=\"reg\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\"><tr><td>";
    echo
"<font face=\"$font\" size=\"$smallerfontsize\">"
and replace with:
PHP Code:
if ($action == "") {
  eval(
"dooutput(\"".gettemplate("photoupload_main")."\");");
}
if (
$action == "update") {
  eval(
"dooutput(\"".gettemplate("photoupload_redirect_update")."\");");

save and upload the Upload.php
then create to Templates. The first one is the Photoupload_main with the folling Context:
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html>
<
head>
<
title>$bbtitle Foto Upload</title>
$headinclude
</head>
<
body>
$header

<!-- breadcrumb -->
<
table cellpadding="2" cellspacing="0" border="0" width="95%"  align="center">
<
tr>
        <
td width="100%"><img src="https://vborg.vbsupport.ru/images/vb_bullet.gif" align="middle" alt="vBulletin">
        <
normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt;
        <
a href="usercp.php?s=$session[sessionhash]">Kontrollzentrum von $bbuserinfo[username]</a> &gt;
        
Foto Upload</b></normalfont></td>
</
tr>
</
table>
<!-- /
breadcrumb -->

<
br>
$cpnav
<br>

<
table cellpadding="0" cellspacing="0" border="0" bgcolor="#0A293E"  width="95%" align="center"><tr><td>
<
table cellpadding="4" cellspacing="1" border="0"  width="100%">
<!-- *** -->
<
tr>
        <
td bgcolor="#1D6AA0" align="left"><normalfont><b>$bbuserinfo[username]'s 
        Foto Upload Informationen</b></normalfont></td>
        <td bgcolor="#1D6AA0" align="right"><normalfont><b><a href=uploadhelp.html onclick="window.open(this.href,'
name','225','225','yes');return false"><img border=0 src=images/upload_files/question.jpg width=18 height=19 alt="Click here to view a user manual, if you are not for sure about something."></a></b></normalfont></td>

</tr>
<!-- *** -->
<tr>
        <td bgcolor="#13486D" colspan="2"><normalfont>
        <smallfont>$welcome</smallfont></normalfont></td>
</tr>

<tr>
        <td width="50%" bgcolor="#1D6AA0"><normalfont><b>Foto Information</normalfont></b></font></td>
        <td width="50%" bgcolor="#1D6AA0"><normalfont><b>Upload Formular</normalfont></b></font></td>
</tr>

<tr>
        <td width="50%" bgcolor="#1C5780"><p align="center"><smallfont color="red"><b>$Warning</b></smallfont><br><br><smallfont><b>$the_void<br><br>$rambo<br></b></smallfont></td>
          <td width="100%" bgcolor="#1C5780">
        <form action="upload.php" ENCTYPE="multipart/form-data"  method="post"><smallfont>hochzuladenes Foto</smallfont><br>
        <input type="hidden" name="action" value="update">
        <input type="hidden" name="MAX_FILE_SIZE" value="2000000">
        <input type="File" name="picture" size="40" maxlength="80"><br>
        <smallfont>Foto Beschreibung</smallfont>
        <br>
        <TEXTAREA Rows="10" COLS="30" NAME="photodesc"></TEXTAREA>
        <input type="submit" name="update_desc" value="Beschreibung"><br>
        <input type="submit" name="submit" value="Upload">
        <input type="submit" name="del_pic" value="l?schen">
        </form></td>
</tr>
    
<tr>
        <td align="center" width="100%" colspan="2" bgcolor="#13486D"><smallfont>Das momentane File ist : </smallfont><smallfont color="red"><b>$alphabravo</b></smallfont><br>
        <smallfont>Foto Beschreibung : </smallfont><smallfont color="red"><b>$spillthebeans</b></smallfont><br>
        <smallfont>Letztes Update : </smallfont><smallfont color="red"><b>$pic_lastupdated&nbsp;@&nbsp;$time4lastupdate</b>$error_msg $willi</smallfont></td>
</tr>

</table>
</table>

$footer

</body>
</html> 
and the second one is the photoupload_redirect_update withe the context:
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<
HTML> <HEAD
<
TITLE>$bbtitle Foto Upload redirect</title>
<
meta http-equiv="Refresh" content="2; URL=$cpurl/upload.php"><body>
$headinclude </head><body> <br>
<
br>
<
table width="100%" border="0" cellspacing="0" cellpadding="0" height="95%" align="center">
  <
tr align="center" valign="middle"
    <
td
      <
table border="0" cellspacing="0" cellpadding="10" bgcolor="#0E3652" width="70%">
        <
tr
          <
td
            <
div align="center"
              <
p><b>Daten wurden aktualisiert</b><normalfont><b>.</b><br>
                <
br>
                </
normalfont><smallfont> <a href="$cpurl/upload.php">Wenn Du nicht l&auml;nger 
                warten m
&ouml;chtestdann dr&uuml;cke hier <br>
                (
ebenfallswenn Dich Dein Browser nicht automatisch weiterleitet).</a
                </
smallfont></p>
            </
div>
          </
td>
        </
tr>
      </
table>
    </
td>
  </
tr>
</
table>
</
body>
</
html
Thats all for this !!! But what is with the Errorhandling?

Any Idear to complete this way?

Greeting Bommelchen

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03555 seconds
  • Memory Usage 2,276KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete