Hotlink for Myspace Hotlink for Myspace
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Hotlink for Myspace

Started by jortiz13, March 05, 2008, 05:02:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jortiz13

How can I get the code to use under myspace? I looked at Topic 36302 but the bbcoce plugin doesn't have it. The two codes under that plugin don't work in myspace

Joachim Müller

I'm not familiar with the bbcode used in myspace. Post an example how it is suppossed to look like.

jortiz13

Here is an example from the other gallery I am working on

<a href="http://www.morestuff4you.com:/gallery"><img src="http://www.morestuff4you.com:/gallery/data/media/9/DSC00078.jpg" border="0" alt="DSC00078.jpg"></a>

jortiz13

#3
This is the entire code I installed on that other gallery. I am sure this will help you better in understanding the codes. I have no idea about programing. The atachment bellow you can see how it looked in the pic page after the code is installed
This code has all most used codes out there for forums websites and like myspace, facebook and those places
I hope this could give you a better idea about the code
I copy and pasted the link from I got the code originally:



Image Codes:
1. Hot link for websites
2. Hot link for forums
3. Thumbnail code for websites
4. Thumbnail code for forums
5. Image link
6. Image path

Please take a backup of all the files before modifying the code

Step 1: (only for people who have not installed the UploadInfo mod)
Open templates/your template name/header.html

Add the below code anywhere inside the <head> tag


Code:

<script type="text/javascript">

function highlight(field) {
        field.focus();
        field.select();
}
</script>


Step 2:
Open templates/your template name/details.html

Add the below code where you want the image codes to appear.


Code:

{image_codes}


Step 3:
Open details.php

Find

Code:
$site_template->print_template($site_template->parse_template($main_template));
Above it, paste:

Code:

//-----------------------------------------------------
//--- ImageCodes v1.0 Begins --------------------------
//-----------------------------------------------------

// Mod: ImageCodes v1.0
// Version: 1.0
// Description : Get image path, link and bbcode on the details page
// Contact: arjoon@gmail.com
// Last update: June 30 2007

$sql = "SELECT image_media_file FROM ".IMAGES_TABLE." WHERE image_id= $image_id";
$image_codes = $site_db->query_firstrow($sql);

$new_name = $image_codes['image_media_file'];

      $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
      $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
      $uploaded_image_link = $script_url."/details.php?image_id=".$image_id;
      $uploaded_thumb_hotlink = "<a href=\"".$uploaded_image_link."\"><img src=\"".$uploaded_thumb_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
      $uploaded_image_hotlink = "<a href=\"".$script_url."\"><img src=\"".$uploaded_image_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
      $uploaded_image_bbcode = "[URL=http://".$script_url."][IMG]http://".$uploaded_image_path."[/img][/URL]";
      $uploaded_thumb_bbcode = "[URL=http://".$uploaded_image_link."][IMG]http://".$uploaded_thumb_path."[/img][/URL]";
      $uploadinfo .= "<font size='2' face='Tahoma'><b>Image Codes:</b><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_hotlink."' type='text' name='image'> Thumbnail for websites<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_bbcode."' type='text' name='image'> Thumbnail for forums<br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>Use the below codes to post the full sized image on other websites or forums</font><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_hotlink."' type='text' name='image'> Hotlink for websites<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_bbcode."' type='text' name='image'> Hotlink for forums<br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>Share this image with your friends</font><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_link."' type='text' name='image'> Share this image<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_path."' type='text' name='image'> Direct path to image<br /><br /></font>";
      $icodes .= "<table border=\"0\" width=\"500px\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";

      $site_template->register_vars("image_codes", $icodes);

Joachim Müller

So you want HTML instead of bbcode to appear...

jortiz13

The code I am more interested in is the one that starts with <a href= this is the code that works in myspace. i am not sure if this is an html or bbcode, sorry for that.

Stramm


jortiz13

#7
I had gone thru that post but is was very confusing because it goes back and forward on some settings and it never worked for me.

So using that info plus using the info I had from my other gallery site that I have the code working and try different settings.... I made it work

I had to hardcode the URL info and eclosed it in " "

I still have one problem I need some help on. The copy button for the code I created is not working I doesn't copy the info to be able to past it at the website.

Here is my entire codebase.php. Please let me what I have wrong for the copy button
Also you can see how I had to come up with the code to make it work in Myspace


<?php
/**************************************************
  CPG BB Code Plugin for Coppermine Photo Gallery
  *************************************************
  Copyright (c) 2006 Thomas Lange <stramm@gmx.net>
  *************************************************
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  *************************************************
  Coppermine version: 1.4.9
  BB Code Plugin version: 1.2
  $Revision: 1.0 $
  $Author: stramm $
***************************************************/


if (!defined('IN_COPPERMINE')) die('Not in Coppermine...');

// Add a filter
$thisplugin->add_filter('file_data','bbcode_add_data');


function 
bbcode_add_data($pic_data){ //$pic_data
global $CONFIG;

//here we define a var that holds the copy to clipboard javascript 
//unfortunately the Firefox security settings do not allow clipboard copy to work without modifying prefs... 
//therefore only a msg pops up if a user uses netscape/ firefox and presses the copy button
$script_data = <<< EOT

<script language="javascript" type="text/javascript">
<!--
function copy_clip(bb_text)
{
 if (window.clipboardData) 
   {
    window.clipboardData.setData("Text", bb_text);
   }
   else if (window.netscape) 
   { 
    alert("Due to Firefox secutrity settings it is not possible to use the copy button. Please manually copy the bb code with 3 fast left clicks into the textara. Then press ctrl+c");
   }
   return false;
}
//-->
</script>
EOT;

$fullsize_url get_pic_url($pic_data);  //here we grab the url to the fullsized pic
$thumb_url get_pic_url($pic_data'thumb'); //thumb url

$pic_data['title'] ? $name $pic_data['title'] : $name 'No Title'//chcking if the pic has a title, if not we set it to 'No title'

//here we define the actual bbcode coppermine path + the path to the pic $img_url is for the version that displays the thumb, $name_url is for a txt link with the ikmage title
$img_url '[url=http://'.$CONFIG['ecards_more_pic_target'].$fullsize_url.'][IMG]http://'.$CONFIG['ecards_more_pic_target'].$thumb_url.'[/img][/url]';
$name_url '[url=http://'.$CONFIG['ecards_more_pic_target'].$fullsize_url.']'.$name.'[/url]';
$img_url2 '<a href="http://www.morestuff4you.com/mygallery/'.$fullsize_url.'"><img src="http://www.morestuff4you.com/mygallery/'.$fullsize_url.'"/></a>';


//this just brings everything in form... we create a table etc.
$bbcode_data '<table align="center" width="'.$CONFIG['picture_width'].'">'.$script_data.'<tr>';
$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="50" style="overflow:off;">'.$img_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="50" style="overflow:off;">'.$img_url2.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$img_url2.'")\'></td>';

$bbcode_data .= '</tr><tr>';

$bbcode_data .= '<td><textarea name="bbcode" rows="3" cols="50">'.$name_url.'</textarea><input type="button" value="Copy" onclick=\'copy_clip("'.$name_url.'")\'></td>';

$bbcode_data .= '</tr></table>';

//finally we add the created stuff to the picture data and return it to coppermine
$pic_data['html'] = $pic_data['html'].$bbcode_data

return $pic_data
}
?>