sabastina
Karma: 0
|
Re:Css image protection code - where to put it? - 2008/05/08 02:42
Thank you for the help.
This is more intimidating then I remember it being! I've worked with php a little bit, but mostly when applying hacks to phpbb forums and zencart - which means I'm used to following instructions to enter code...so I'm not able to just jump in and understand all of what I am reading, and I tend to get nervous - I think I will need a little guidance to learn how to do this (but that's the key, I would like to try to do this myself and then maybe share it with the community - if that is possible and ok?)
What I will do, is to post the remository code for the areas I think I need to work with, then while I wait for you to let me know if this is the proper code I should be looking at for this hack, I will go and study .php at w3schools.
Because I'm new at this, and wish to share it with other remository users, I want to be sure I am doing it in the proper way to make sure I don't cause errors and such...and I do appreciate your time and help very much!
Ok, I think that I need to look at this code here -because of the function displayThumbnail command line. Is this correct?
| Code: | function displayThumbnail ($item, $link=true) {
if ($this->count == 0) return \' \';
$html = \"\\n\\t\\t\\t<div class=\'remositorythumbnail\'>\";
if ($link) {
if ($this->allow_large) {
$alt_text = \'View Full Sized Screenshot\';
if ($this->maxcount) {
$imginfo = getimagesize($this->img_paths[$item]);
$imgw = $imginfo[0]+20;
$imgh = $imginfo[1]+20;
}
else {
$repository =& remositoryRepository::getInstance();
$imgw = $repository->Large_Image_Width;
$imgh = $repository->Large_Image_Height;
}
$imglink = $this->img_URLs[$item];
//get the x and y size of the full sized image
$html .= \"\\n\\t\\t\\t\\t<a href=\\\"javascript:void(0)\\\" onclick=\\\"window.open(\'$imglink\',\'FullSize\',\'width=$imgw,height=$imgh,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizab
le=0,copyhistory=0\')\\\">\";
}
else $alt_text = \'Full screenshots disabled\';
}
else $alt_text = \'Thumbnail image\';
if ($this->maxcount) {
$thinfo = getimagesize($this->thumb_paths[$item]);
$thw = $thinfo[0];
$thh = $thinfo[1];
}
else {
$repository =& remositoryRepository::getInstance();
$thw = $repository->Small_Image_Width;
$thh = $repository->Small_Image_Height;
}
$thlink = $this->thumb_URLs[$item];
$html .= \"\\n\\t\\t\\t\\t<img width=\\\"$thw\\\" height=\\\"$thh\\\" alt=\\\"$alt_text\\\" src=\'$thlink\' />\";
//create a thumbnail image linked to full size image
if ($link AND $this->allow_large) $html .= \'</a>\';
if (isset($this->img_texts[$item])) $html .= \"\\n\\t\\t\\t\\t<div>{$this->img_texts[$item]}</div>\";
$html .= \"\\n\\t\\t\\t<!-- End of remositorythumbnail -->\";
$html .= \"\\n\\t\\t\\t</div>\";
return $html;
}
function displayOneThumbnail () {
if ($this->count == 0) return \'\';
if ($this->count > 1) $item = rand(0,$this->count-1);
else $item = 0;
if (isset($this->thumb_URLs[$item])) return $this->displayThumbnail($item);
else {
$repository =& remositoryRepository::getInstance();
return $repository->RemositoryImageURL(\'blank.gif\', $repository->Small_Image_Width, $repository->Small_Image_Height);
}
}
function displayAllThumbnails () {
if ($this->count == 0) return \'\';
$html = \"\\n\\t\\t\\t<div class=\'remositorythumbset\'>\";
for ($item=0; $item<$this->count; $item++) {
$html .= \'<div>\'.$this->displayThumbnail($item).\'</div>\';
// if (($item+1) % _THUMBNAILS_PER_COLUMN == 0) echo \'</tr><tr><td> </td></tr><tr>\
';
}
$html .= \"\\n\\t\\t\\t<!-- End of remositorythumbset -->\";
$html .= \"\\n\\t\\t\\t</div>\";
return $html;
}
|
I will go study php, then check back here. Once I know this is the correct code to look at, I will isolate exactly where in this code I will need to place the code - then you could tell me if that is correct for this.
Oh, would I need to create a variable for this part of the prevention code I'm using?
| Code: | $div style=\"position:absolute; top:10; left:10; width:400; height:75; z-index:1; padding:0px; border: #000000
1px solid; background-image:url(yourImage.ext);\"#$/div#
|
I'm not clear how to handle this type of code so that it is limited to the Remository componet and not the entire site. It makes sense to create the variable for it because I later need to enter the following code directly to the code that calls the thumbnails...
| Code: |
$div id=\"cover\"#$/div#
|
Also, I figured that I needed to code the 'header' portion of the code into the index.php for Remository. I did that like this (is this the proper way to do this so that it works only for the Remository?):
| Code: | <html>
<head>
style type=\"text/css\"#
$!--
div#cover{ position:absolute; top:0; left:0; width:100%; height:100%; z-index:2; background-image:
url(overlay.gif); image-
repeat:repeat;
--#
$/style#
</head>
<body bgcolor=\"#FFFFFF\">
</body>
</html>
|
I'm off to look into php and css for a while.
Thanks for helping with this!
|