Note: See updates further down in this thread, as the scope of this project has changed somewhat, and now incorporates CPMFetch.
---------------
I would like to add a "Add this to your MySpace" (or website, or blog, etc.) I can handle the coding of this part itself, but I'm absolutely lost when it comes to the templating system used in CPG. I dunno if this is in line with the "one question per thread" idea, but it is all associated with one concept... I jst can't find the right places to grab teh appropriate variables, etc. Mods, feel free to break this into a couple of threads if you prefer, though I think that this ought to stay as is due to the fact that so many users would like this functionality. (Which I'll be glad to share once I figure out how to generate the assorted URLs and so forth that I need to finish the code.) It definitely falls under skinning, etc, but it might be big enough of a project to put in a "mods wanted" thread. Either way, I need a little help, and then I can take it from there and work out the rest of the mod.
Here's a pretty relevant (non-CPG) of what I'm trying to do:
http://www.bofunk.com/video/991/sexy_runner.html#myspacecodeNote: I'm going to be thinking out loud here so that anybody who wants to assist (or use this) can stay on the same train of thought as me.
Here's what I'm thinking so far... (My site has lots of pics, videos, and flash (and more, but nobody would really want to feature a font on their MySpace/Blog... LOL), so it needs to work across the board, regardless of media type. I mention this only because Pics generate thumbs automatically, whereas videos require a custom thumb, and I'm not sure whether this makes a difference. Most of my vids have custom thumbs, but I need to be able to default to the generic media thumb if the video has no custom thumb associated with it.)
I will need the following URLs in variable form:
1. The Static URL for the page (displayimage.php?pos=-2724)
2. The URL for the associated thumbnail, or if no thumb then the associated generic thumb
3. The direct URL to the video/picture (There's a variation of it mentioned here:
http://forum.coppermine-gallery.net/index.php?topic=3082.0)
From there, it seems that I can just write code along the lines of:
1. (code to determine filetype and generate appropriate embed code)
2. If it is a picture, simply use the pic's URL
3. If it is a video, use the same embed code as is on the displayimage.php page already (should be easy enough since the page has already generated it)
4. Since the video, etc. will be in a table on the user's site, the next table row will have a "This came from" nice link pointing to example.com/gallery/displayimage.php?pos=-$MISSINGVARIABLE, and another "View more funny pictures and videos at" link pointing to the main gallery. (The second part can be hardcoded to whatever URLs you desire for your site unless somebody turns it into a "legitimate" mod, in which case you can use variables.)
5. Side thought: It'll need to be in an iframe so that I can use a custom PHP page (which I'll need to write from scratch) to call and show the video. That way, the video is being called from MY site, and I can still block hotlinking via .htaccess.
Any of this make sense? Here's a screenshot of the envisioned finished product, as it would appear on the user's website.blog.MySpace, etc.
http://www.jakesjokes.com/img/examplevideo.jpgEdit:To clarify, I specifically need to know how to find (or call) the variables that represent the static URL, the thumbnail URL, and the absolute URL for the image/video.
Edit:The only reference to a variable that seems like it would work is in line 170 of displayimage.php.
$info[$lang_picinfo['URL']] = '<a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" >' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') . basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '</a>';
With the relevant portion being the part below...
?pos=-$CURRENT_PIC_DATA[pid]
Am I at least getting into the right neighborhood? Anybody? Gurus? Non-gurus? Santa Claus? I'll accept feedback/help from anybody...
PS - A little off-topic, but I've noticed a distinct lack of activity in this thread from anyond other than me. Is there anybody out there interested in this sort of thing, or doesn't anybody else enjoy getting lots of traffic?
Yes, allowing yoru pics and videos to show on other sites uses your bandwidth, but bandwidth is cheap nowadays. I won't promote my host right now (because I wouldn't be able to stop myself from using my affiliate link to do so), but I have thousands and thousands of visitors daily (enough to make a full time living from the site), and don't even come close to using my allotted bandwidth... and I pay less than $50 a month for the whole package (bear in mind that that includes a lot of extras that most people wouldn't need... prices are as low as $7.95 for packages that are actually good and not "barebones" hosting. Of course there are also those who charge less (though I can't vouch for their reliability, so do your research...) Besides, if it is on a small site with little traffic, you won't use much bandwidth. If it's on a large site, it'll use a decent amount of bandwidth, but it will result in more visitors to your site, hence making you back the money to pay for the bandwidth (assuming you have ads, etc.)
Jake