PDA

View Full Version : Styleshhet problems with PP and VB3.5


mclare
November 27th, 2005, 10:56 PM
I just upgraded to vb 3.52 and PhotoPost's latest version and I am also running vbPortal (latest version) and now my integrated style sheets are not working. Here is the URL: http://www.artists-exchange.com/covers/index.php

Thanks in advance,

mtha
November 28th, 2005, 02:56 AM
1. Latest version of vB is 3.5.1
2. Maybe You did not chose to use vB's style in admin section:

vB3 INTEGRATION
Do you want to enable the vB3 Integration which uses your vB3 headers, footers and styles? = YES

Chuck S
November 28th, 2005, 10:14 AM
Exactly mtha ;)

Looks like he has not turned on any of the vb3 integration under edit integration and your forum options USE FORUM STYLE is set to no not yes.

mclare
November 30th, 2005, 12:07 PM
I had turned it on, but when I do it uses no template at all. I have it turned on now and look at what it does. Before I had upgraded, it worked fine. BTW, I am a programmer with over 25 years exp. so I have tried many things already, that is why I am asking for your help... :)

Chuck S
November 30th, 2005, 12:47 PM
If I go here though you do not have vb3 integration turned on in edit integration in admin

Your loading a default photopost

http://www.artists-exchange.com/covers/index.php

I would be glad to help. You can PM me your admin login and I can show ya how to set it up

HobbyTalk
November 30th, 2005, 12:57 PM
I show your gallery is using http://artists-exchange.com/covers/stylesheets/default.css for the style sheets but your forum is using http://artists-exchange.com/vbportal_demo.css so it is not pulling the correct style sheet.

You have two places to setup the integration on PP. Make sure both Edit Integration and Forum Settings in the PP AdminCP is set correctly.

Chuck S
November 30th, 2005, 01:07 PM
Yep the vb3 integration is turned off in his edit integration settings.

He has correctly set use forum style to yes which is why there is a white page with no style but has not turned on the vb3 integration. Once VB3 integration settings are set and turned on in edit integration things will be fine.

mclare
November 30th, 2005, 07:57 PM
Thanks to all of you, that fixed it...

Most appreciative....

mclare
November 30th, 2005, 07:58 PM
Now - does anyone know how to add a "Download Photo" link when you click on a photo?

Chuck S
November 30th, 2005, 08:05 PM
Why not just select in showphoto options UBBCODE to yes

mclare
November 30th, 2005, 08:52 PM
Well because I deal with people that do a lot of downloads of photos in a session and it is time consuming to do that. I just need a link that when they are looking at the Med image, there is a link that would say "Download Photo" and they could just click it and it would bring up the download queue.

I tried it with this third party software, but it was unreliable. I need a good reliable download photo link.

Anyone that can solve this will get membership into my board of course.

Chuck S
November 30th, 2005, 09:40 PM
maybe something like this code in bold added to the showphoto.tmpl page above the code noted here


echo<<<PPPRINT

<tr>
<td colspan="2" class="{$Style['tddetails']}" align="left" valign="top">
<b>Download Link:</b> &nbsp;&nbsp;&nbsp;<a href="{$imgurl}">Download this file</a>
</td>
</tr>

PPPRINT;

if ( $Globals['showubb'] == "yes" && $imgurl != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" colspan="2" align="left" valign="top">
<script language="javascript" type="text/javascript">
<!--
function copy_to_clipboard()
{
window.clipboardData.setData("Text", "{$showcode}");
};
//-->
</script>
<span class="{$Style['small']}"><b>{$Globals['pp_lang']['ubbcode']}:</b> <input type="text" name="ubb" value="$showcode" size="80" onclick="this.focus();this.select()"> &nbsp;&nbsp;&nbsp;&nbsp;
<script language="javascipt" type="text/javascript">
<!--
if((typeof clipboardData != 'undefined') && (clipboardData.setData) && (document.write)){
document.write('<input type="button" style="font-size:7pt;" value="{$Globals['pp_lang']['copyto']}" onclick="copy_to_clipboard()" />');
}
//-->
</script></span>
</td>
</tr>
PPPRINT;
}

mclare
November 30th, 2005, 10:00 PM
Here is what I did, but the link does not show up... :


echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" align="left" valign="top">
Download Link
</td>
<td class="{$Style['tddetails']}" align="left" valign="top">
<a href="{$imgurl}">Download this file</a>
</td>
</tr>
PPPRINT;

if ( $Globals['showubb'] == "yes" && $imgurl != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" colspan="2" align="left" valign="top">
<script language="javascript" type="text/javascript">
<!--
function copy_to_clipboard()
{
window.clipboardData.setData("Text", "{$showcode}");
};
//-->
</script>
<span class="{$Style['small']}"><b>{$Globals['pp_lang']['ubbcode']}:</b> <input type="text" name="ubb" value="$showcode" size="80" onclick="this.focus();this.select()"> &nbsp;&nbsp;&nbsp;&nbsp;
<script language="javascipt" type="text/javascript">
<!--
if((typeof clipboardData != 'undefined') && (clipboardData.setData) && (document.write)){
document.write('<input type="button" style="font-size:7pt;" value="{$Globals['pp_lang']['copyto']}" onclick="copy_to_clipboard()" />');
}
//-->
</script></span>
</td>
</tr>
PPPRINT;
}


Thanks for the fast reply..

mclare
November 30th, 2005, 10:05 PM
BTW - That is a great avatar... Do you have a reef tank?

mclare
November 30th, 2005, 10:48 PM
Okay, I forgot and put it in the wrong place and now put it in the vb2templates and now I get this error:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /hsphere/local/home/mclare/artists-exchange.com/covers/templates/vb3enhanced/showphoto.tmpl on line 277

I did put in the opening and closing braces and now the code reads:


{
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" align="left" valign="top">
Download Link
</td>
<td class="{$Style['tddetails']}" align="left" valign="top">
<a href="{$imgurl}">Download this file</a>
</td>
</tr>
PPPRINT;
}

if ( $Globals['showubb'] == "yes" && $imgurl != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" colspan="2" align="left" valign="top">
<script language="javascript" type="text/javascript">
<!--
function copy_to_clipboard()
{
window.clipboardData.setData("Text", "{$showcode}");
};
//-->
</script>
<span class="{$Style['small']}"><b>{$Globals['pp_lang']['ubbcode']}:</b> <input type="text" name="ubb" value="$showcode" size="80" onclick="this.focus();this.select()"> &nbsp;&nbsp;&nbsp;&nbsp;
<script language="javascipt" type="text/javascript">
<!--
if((typeof clipboardData != 'undefined') && (clipboardData.setData) && (document.write)){
document.write('<input type="button" style="font-size:7pt;" value="{$Globals['pp_lang']['copyto']}" onclick="copy_to_clipboard()" />');
}
//-->
</script></span>
</td>
</tr>
PPPRINT;
}

Thanks

mclare
December 1st, 2005, 12:10 AM
Okay, I got it working and there are only 2 minor problems:

1. The link is the medium image and not the fullsized image.

2. The link does not open the "save as..." dialog box but instead display's that image so the user has to do the right click thing.

Should be easy...

Is there somewhere that all of the variables listed and how the program is laid out?

THANKS AGAIN! ! !

Chuck S
December 1st, 2005, 08:19 AM
$imgurl changes depending on the size of the photo. Otherwise you will probally need to define a new variable if all you want is the large url

In showphoto.php make this?


$showcode = ""."$imgurl"."";
$downurl = "{$Globals['datadir']}/$storecat/$bigimage";

mclare
December 1st, 2005, 11:34 AM
Where would that go? I have tried several combination of things and still cannot get it to work. I would be willing to pay a fee to get this thing to work if anyone can get it to work.

I just need a link that a person can click on and it will pop up a dialog box and let you download the full sized image...

Thanks

Chuck S
December 1st, 2005, 12:00 PM
Well I dont know about a download link to auto download probally need some java for that but the code I meantioned was to place in showphoto.php and then in showphoto.tmpl in the html you entered replace $imgurl with $downurl and thats gonna give you the large image every time

mclare
December 1st, 2005, 12:17 PM
I did that and it did not work... :(

mclare
December 1st, 2005, 12:18 PM
if ( $Globals['showubb'] == "no" && $imgurl != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" align="center" valign="top"><a href="{$downurl}">Download this file</a>
</td>
</tr>
PPPRINT;
}



And:


define( 'THIS_SCRIPT', "showphoto" );
require "pp-inc.php";

$showcode = ""."$imgurl"."";
$downurl = "{$Globals['datadir']}/$storecat/$bigimage";

$PATH_INFO = findenv("PATH_INFO");
if ( isset($PATH_INFO) && $Globals['spider'] == "yes" ) {
$test = explode('/', substr($PATH_INFO,1));
for($i=0; $i < count($test); $i++){
if( $i % 2 == 0 ) { $_REQUEST[$test[$i]]

Chuck S
December 1st, 2005, 12:31 PM
well it surely works as posted. ;)

I see your issue. You did not place the $downurl line where it belongs. I stated to add the code in bold where the other line is. $showcode is at the bottom of showphoto.php ;)

search showphoto.php and place the line in bold I gave you down there and then edit your showphoto template as below and you will see it works.


echo<<<PPPRINT

<tr>
<td colspan="2" class="{$Style['tddetails']}" align="left" valign="top">
<b>Download Link:</b> &nbsp;&nbsp;&nbsp;<a href="{$downurl}">Download this file</a>
</td>
</tr>

PPPRINT;



This surely places a link to the large image of the picture.

mclare
December 1st, 2005, 10:15 PM
I did this:

$downurl = "{$Globals['datadir']}/$storecat/$bigimage";

And what happens is that it gives this url for the link:

"http://www.artists-exchange.com/covers/data/"

And does not show the category or bigimage name

mclare
December 1st, 2005, 10:27 PM
Okay, I fixed the url amd now I just need it to pop up the download dialog instead of displaying the image. Any ideas? If I find the code, could you help me integrate it?

Thanks again Chuck

Chuck S
December 1st, 2005, 10:45 PM
I dont know the specifics of how to do a download versus display but if you find something let me know

mclare
December 1st, 2005, 11:42 PM
Okay, I found this:

It is the code to force the download. do you think you could figure out how to integrate it into PP?


<?php
$strFilePath = "C:\ whatever the path is ";
$strFileSize = filesize($strFilePath);
$strFileName = basename($strFilePath);

$fileContents = file_get_contents($$strFilePath);
$pathinfo = pathinfo($strFilePath);
$strFileType = $pathinfo['extension'];

switch ($strFileType) {
case 'asf':
$ContentType = 'video/x-ms-asf';
break;
case 'avi':
$ContentType = 'video/avi';
break;
case 'doc':
$ContentType = 'application/msword';
break;
case 'zip':
$ContentType = 'application/zip';
break;
case 'xls':
$ContentType = 'application/vndms-excel';
break;
case 'gif':
$ContentType = 'image/gif';
break;
case 'jpg':
case 'jpeg':
$ContentType = 'image/jpeg';
break;
case 'wav':
$ContentType = 'audio/wav';
break;
case 'mp3':
$ContentType = 'audio/mpeg3';
break;
case 'mpg':
case 'mpeg':
$ContentType = 'video/mpeg';
break;
case 'rtf':
$ContentType = 'application/rtf';
break;
case 'htm':
case 'html':
$ContentType = 'text/html';
break;
case 'asp':
$ContentType = 'text/asp';
break;
case 'mov':
$ContentType = 'video/quicktime';
break;
case 'txt':
$ContentType = 'text/plain';
break;
default:
//Handle All Other Files
$ContentType = 'application/octet-stream';
}

header("Content-Type: $ContentType);
header("Content-Length: $strFileSize");
header("Content-Disposition:attachment; filename=$strFileName");

echo $fileContents;
?>

mclare
December 2nd, 2005, 11:17 AM
Here is another piece of code:

function download($path)

global $HTTP_USER_AGENT;
$file=basename($path);
$size = filesize($path);
header("Content-Type: application/octet-stream");
header("Content-Type: application/force-download");
header("Content-Length: $size");
// IE5.5 just downloads index.php if we don't do this
if(preg_match("/MSIE 5.5/", $HTTP_USER_AGENT))

header("Content-Disposition: filename=$file");
} else

header("Content-Disposition: attachment;
filename=$file");
}
header("Content-Transfer-Encoding: binary");
$fh = fopen($path, "r");
fpassthru($fh);
}