PDA

View Full Version : Request: adding a photo of the photographer.


ErickL
1st of March 2004 (Mon), 13:09
Moe Pekka,
I just updated to 1.5 RC 2. I would like to request adding a photo of the photographer, like I did on my photographer page:
http://www.erickleskinen.com/gallery/photographer.php?owner=52

I modified the photographer.php file and ee_owners table as follows:
I didn't modified the photographer editor yet, I inserted a record by hand (SQL).

Added field ee_owner_photo_url to ee_owner:
mysql> desc ee_owner;
+--------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+--------------+------+-----+---------+----------------+
| ee_owner_id | int(11) | | PRI | NULL | auto_increment |
| ee_owner_name | varchar(255) | | | | |
| ee_owner_email | varchar(255) | | | | |
| ee_owner_homepage | text | | | | |
| ee_owner_photo_url | varchar(255) | | | | |
| ee_location_id | int(11) | | MUL | 1 | |
| ee_country_id | int(11) | | MUL | 191 | |
+--------------------+--------------+------+-----+---------+----------------+


photographer.php file:
<?php

header("Expires: Mon, 15 Apr 2002 05:00:00 GMT"); // Date in the past

header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified

header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1

header("Cache-Control: post-check=0, pre-check=0", false);

header("Pragma: no-cache"); // HTTP/1.0

ob_start();

// shift background color for this page?

$hex2darker = "1";





include ("toroot.php");

include ($toroot . "add/connect.php");

include_once ($toroot . "SCRIPT_uncookied.php");



if (isset($HTTP_POST_VARS['u'])) {

$u = $HTTP_POST_VARS['u'];

ee_uncookied_extract ($u); // now we have all post variables back

}

if (isset($HTTP_GET_VARS['u'])) {

$u = $HTTP_GET_VARS['u'];

$u = str_replace($uncookied_foochar,"",$u);

$vartalo = explode($uncookied_splitter,$u);

$u = $vartalo[0];

if (isset($vartalo[1])) {

$offset = $vartalo[1];

}

ee_uncookied_extract ($u); // now we have all get variables back

}





include ($toroot . "language.php");

include ($toroot . "slashwork.php");

$getlang = $toroot . "languages/" . $lang . "/global.php";

include($getlang);





if (!isset($size)) {

$size="default";

}



if (isset ($HTTP_GET_VARS['exhibition'])) {

$exhibition = $HTTP_GET_VARS['exhibition'];

}

if (!isset($exhibition)) {

// GET LIST OF PUBLIC EXHIBITIONS, to reuse the same array several time later we're using the reset command

include ($toroot . "add/allowedexhibitions_sql.php");

@$valid = $allowedexhibs[0][0];

$exhibition=$valid;

}



if (isset($HTTP_GET_VARS['owner'])) {

$owner = $HTTP_GET_VARS['owner'];

}

if (!isset($owner)) {

$owner="1";

}







$e = mysql_query(

"

SELECT DISTINCT

ee_exhibition_{$lang}.ee_exhibition_name

FROM

ee_exhibition_{$lang}

WHERE

ee_exhibition_{$lang}.ee_exhibition_id = '$exhibition'

"

);

if (!$e) {

$queryname = "e";

include($toroot . "db_error.php");

}



while

($ex_name = mysql_fetch_array($e)) {

$exhibname = $ex_name["ee_exhibition_name"];

}



include ($toroot . "fetchsettings.php");





$get_owner = mysql_query(

"

SELECT DISTINCT



ee_owner.ee_owner_id,

ee_owner.ee_owner_name,

ee_owner.ee_owner_email,

ee_owner.ee_owner_homepage,

ee_owner.ee_owner_photo_url,

ee_owner_{$lang}.ee_owner_text,

ee_location.ee_location_name,

ee_country_{$lang}.ee_country_name,

ee_country_{$lang}.ee_country_id



FROM

ee_owner,

ee_owner_{$lang},

ee_country_{$lang},

ee_location



WHERE

ee_owner.ee_owner_id = '$owner'

AND ee_location.ee_location_id = ee_owner.ee_location_id

AND ee_country_{$lang}.ee_country_id = ee_owner.ee_country_id

AND ee_owner_{$lang}.ee_owner_id = ee_owner.ee_owner_id

"

);

if (!$get_owner) {

$queryname = "get_owner";

include($toroot . "db_error.php");

}







while

( $add = mysql_fetch_array($get_owner) )

{



if ($add["ee_owner_email"]!="") {

$email = ee_stripslashes($add["ee_owner_email"]);

}

else {

$email = "";

}



$email = str_replace("@"," at ",$email);

$email = str_replace("."," dot ",$email);



$www = ee_stripslashes($add["ee_owner_homepage"]);



$name = ee_stripslashes($add["ee_owner_name"]);

if ($name == "Unknown") $name = "----";



$text = ee_textblock_print(ee_stripslashes($add["ee_owner_text"]),1,1);



$url = "<a href=\"" . $www . "\" TARGET=\"_new\">" . $www . "</a>";


$photo_url = ee_stripslashes($add["ee_owner_photo_url"]);



if ($photo_url != "") {



$photo = "<table border=\"0\" align=\"left\" cellpadding=\"3\"><tr><td><img src=\"" . $photo_url . "\" alt=\"\" border=\"0\"><p></p></td></tr></table>";



}



if ($photo_url == "") {



$photo = "";



}



if ($add["ee_location_name"]!="Unknown") {

$location = ee_stripslashes($add["ee_location_name"]);

}

else {

$location = "";

}



if ($add["ee_country_id"]!="191") {

$country = ee_stripslashes($add["ee_country_name"]);

}

else {

$country = "";

}

?>



<HTML>

<HEAD>

<TITLE>

<?php

print "'" . $exhibname . "': " . ee_html_conversion(ee_translate_A($translated["photographer"])) . " " . $name;

?>

</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=<?php print $s_charset; ?>">



<?php

print $stylesheet;

?>



</HEAD>

<BODY>

<?php

if ($s_on == "0") {

print $s_off_message;

exit();

}

?>









<table border="0" cellspacing="0" cellpadding="0">

<tr><td>



<?php

















print "<big style=\"font-family: Arial, Helvetica, sans-serif; font-size: 18px;\">" . $name . "</big><p>";

print $photo;

print "<b>" . ee_html_conversion(ee_translate_A($translated["email"])) . ": </b>" . $email;

print "<br>";

print "<b>" . ee_html_conversion(ee_translate_A($translated["website"])) . ": </b>" . $url;

print "<br>";

print "<b>" . ee_html_conversion(ee_translate_A($translated["location"])) . ": </b>" . $location;

print "<br>";

print "<b>" . ee_html_conversion(ee_translate_A($translated["country"])) . ": </b>" . $country;

















print "<p>" . $text . "</p>";



}



?>

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

<center><FORM><INPUT TYPE="Button" NAME="close" value="<?php print ee_html_conversion(ee_translate_A($translated["close_this_window"])); ?>" onclick="window.close();"></FORM></center>







<?php

mysql_close ($dbcnx);

?>



<!-- Coding, structure and concept by Pekka Saarinen ©2002 -->

</BODY>

</HTML>

<?php

ob_end_flush();

?>

Pekka
1st of March 2004 (Mon), 13:28
Yes this has been on my wish list. As it is relatively easy to add to editor, I'll most likely do it for RC3.