windowtarget code not parsing? - Page 2 windowtarget code not parsing? - Page 2
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

windowtarget code not parsing?

Started by Tranz, September 17, 2006, 07:49:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

nickfzx

thanks for getting back

no worries...I have come up with a compromise...put the link in the subtitle and make it small...

check it out here:
http://amateurillustrator.com.s2734.gridserver.com/forums/

Should make my forum more fun to use.

Cheers

vuud

Quote from: nickfzx on November 30, 2006, 05:02:01 PM
thanks for getting back

no worries...I have come up with a compromise...put the link in the subtitle and make it small...

check it out here:
http://amateurillustrator.com.s2734.gridserver.com/forums/

Should make my forum more fun to use.

Cheers

Nice!  Can you post your final cpmfetch code for it for others here?
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

nickfzx

sure...I had to go back to large images because there was a fault with my solution to get the normal sized images...which is this:
when an image is smaller than a certain size coppermine does not create a midsize (intermediate) image it just uses the original image.

So when I click the thumbnail of one of these images it doesn't find anything because they don't have the prefix "normal_".

So for now I have stuck with large images...in order for this to work with the normal images I would have to run a directory check i think and search for normal_filename and if it cant find it, then it uses filename (without the prefix).

But for now I've stuck with large images.

Because of the way punbb works you can't include php in the template (theme) file so there are two files involved here (but there could easily be only one)....for simplicity I will post as if there is only one file:


<script type="text/javascript" src="./highslide/highslide.js"></script>


<script type="text/javascript">   
    hs.graphicsDir = './highslide/graphics/';
    window.onload = function() {
        hs.preloadImages();
    }
</script>

</div><div id="highslide-container"></div>

<?php
require_once "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("../galleries");

$styleguide = array(
//"TABLESTYLE" => "photoclip",
//"rowstyle" => "photoclip",
"cellstyle" => "photoclip",
//"linkstyle" => "photoclip",
"alttag" => "Click on thumbnail to see full-sized image",
"imagestyle" => "photoclip",
"cellattributes" => array('align' => 'center', 'width' => '100', 'height' => '100'),
'imagelink' => 'large',
'subtitle' => '<a href="http://www.amateurillustrator.com/galleries/displayimage.php?pos=-%i">%o</a>',
"linkstyle" => 'highslide" onclick="return hs.expand(this)" onmouseover="self.status=\'Click to enlarge thumbnail\'; return true;');
$objCpm->cpm_viewRandomMedia(1,7, $styleguide); 
$objCpm->cpm_close();
?>




to see the code in action look here:
http://www.amateurillustrator.com/forums/

hope this helps.

vuud

Quote from: nickfzx on November 30, 2006, 09:24:02 PM
sure...I had to go back to large images because there was a fault with my solution to get the normal sized images...which is this:
when an image is smaller than a certain size coppermine does not create a midsize (intermediate) image it just uses the original image.

So when I click the thumbnail of one of these images it doesn't find anything because they don't have the prefix "normal_".

So for now I have stuck with large images...in order for this to work with the normal images I would have to run a directory check i think and search for normal_filename and if it cant find it, then it uses filename (without the prefix).

I will post my code when I get back... It will let you do that, and will be a good example of using internals of cpmfetch to do this for you (there are routines that can get the right image for you).

Very nice site, I spent too much time browsing it today...


Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

nickfzx

i noticed that here:

http://takethu.com/blog/?p=144

TranceNDance has managed to get the image link into the blog...

would you mind shareing your code for this...I spent ages trying to figure it out.

Tranz


nickfzx

sorry TranceNDance I thought you had a "Details" link in the caption of randomly slected images...but I see that you already new what the url was for the images that have them in the caption...i see that in your sidebar you have the details link underneath the random image like I do.

I think it would be a lot of work to get the details link to work in the caption of randomly selected images.

Cheers

Nick


vuud


Here is the code I was playing with on this... sorry for the delay on posting this

Some notes:

  • This is done with the dev version of cpmfetch, some calls may differ to the stable version, but it is entirely possible
  • I ommited all the html parts of this page almost
  • I left a print_r at the bottom so you get a dump of what is in the data array and know what you can use or have access to
  • Since we bypass the whole html output mechanism, its up to you to make rows and columns
As I mentioned before this is just tinkering code, no effort has been made to insure it is correct, or optimized, or clean, or pretty much anything.

i think the only difference to using this with a stable cpmfetch is that the:

$objCpm->getImageToUse

would be something like

$objCpm->cpm->getImageToUse

But I do not have it in front of me to double check


<?php
include "cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_setReturnType("resultset");
$objCpm->cpm_debugMode(false);
$data $objCpm->cpm_viewRandomMedia(5,5);

foreach (
$data as $row) {

$pathtozoomimage $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"");
$pathtosmallimage $objCpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"thumb_");

?>


<a href="<?php echo $pathtozoomimage ?>"
        rel="<?php echo $pathtozoomimage ?>"
        class="highslide" onclick="return hs.expand(this)" id="<?php echo $row['pFilename']?>">
        <img style="margin-top: 20px" width="120" height="80"
                src="<?php echo $pathtosmallimage ?>" alt="Highslide JS"
                   title="Click to enlarge" />
        </a>

        <div class='highslide-caption' id='caption-for-<?php echo $row['pFilename']?>'>
        <a href="javascript:hs.closeId('<?php echo $row['pFilename']?>')" class="control">| Close |</a>
        This instance uses graphic outlines to create a rounded border with a drop shadow.
        Also note how this image is centered in the browser window.
        </div>

<?php

}

echo 
"<pre>";
print_r ($data);
echo 
"</pre>";

$objCpm->cpm_close();

?>
                                                 

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

nickfzx

cool thanks vuud

is there a place where i can see it in action?

vuud

Quote from: nickfzx on December 01, 2006, 05:59:49 PM
cool thanks vuud

is there a place where i can see it in action?

Not yet... its running on my development server, so there is no way to get there from outside.  That and it does not really look that nice yet.

Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Tranz

It's no problem to get the details code if you know how to do it. I use a version of the bbcode mod except I changed the code so that it generates the html I need to put into the blog post. If you're familiar with the bbcode mod and willing to install it, I'll dig up the code to add to the mod to generate the highslide code.

vuud

Quote from: TranzNDance on December 02, 2006, 04:21:15 AM
It's no problem to get the details code if you know how to do it. I use a version of the bbcode mod except I changed the code so that it generates the html I need to put into the blog post. If you're familiar with the bbcode mod and willing to install it, I'll dig up the code to add to the mod to generate the highslide code.

I have a string parser class that I use to do the BBCode stuff on another project.  Thing is that it is heavy, but it is a full parser (not a regexp list).  What do you use?  I should really have this built into cpmfetch...  Or at least stripping them out...



Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Tranz

In displayimage.php:
$info['Highslide HTML'] = '
&lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA) .  '" class="highslide" onclick="return hs.expand(this)" onmouseover="self.status=\'Click to enlarge thumbnail\'; return true;"
  &gt;&lt;img src="'. $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . get_pic_url($CURRENT_PIC_DATA,'thumb') . '" height="' . $CONFIG['thumb_width'] . '" alt="' . $CURRENT_PIC_DATA['title'] . '" align="left" border="0" title="Click to enlarge" id="thumb' . $CURRENT_PIC_DATA[pid] . '" /&gt;&lt;/a&gt;
  &lt;div class="highslide-caption" id="caption-for-thumb' . $CURRENT_PIC_DATA[pid] . '"&gt;
  &lt;a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" &gt;Details&lt;/a&gt; 
&lt;/div&gt;';


I wrapped mine inside a conditional so that only I as admin can see the output... no point in visitors seeing the code if I don't want people to hotlink.