How to change url in codebase of coppermine photo site

Discussion in 'PHP' started by jbandp, Feb 21, 2010.

  1. #1
    Hi, I have a coppermine (PHP) site that I use to host "myspace" type comments/graphics on. When someone copies a comment from my site and pastes it on a a webpage, it leaves a link back to my site.

    In the codebase.php file (? -- I think?) I want to redirect/change both: the active url that makes the graphic "clickable" and the "img_src" code to: another url, other than the one for the site.

    For example: Current version of a code

    <center><a href="http://www.mywebsite.com/displayimage.php?pos=-63996" ><img src="http://www.mywebsite.com/albums/userpics/10064/normal_mjh1%7E0.jpg" border="0"><br>

    I would like to redirect the original url to another one, like:

    <center><a href="http://www.anotherwebsite.com/displayimage.php?pos=-63996" ><img src="http://www.anotherwebsite.com/albums/userpics/10064/normal_mjh1%7E0.jpg" border="0"><br>

    Here is the codebase.php file:

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

    //Places a text box in the file information list that allows you to embed an image on another site.
    $thisplugin->add_filter('file_info','html_embed');

    function html_embed($info)
    {
    global $information;
    global $CONFIG;
    global $CURRENT_PIC_DATA;

    $info['Embed URL'] = '<table cellpadding="0" cellspacing="1" border="0">';
    $info['Embed URL'] .= '<tr><td><b><font color=yellow>HTML Code: For PROFILE pages & COMMENT Walls, or "Autographs" in MyYearbook: (Right click) "Copy" the code below and then (right click) "paste" it, where you want this pic to appear. On MyYearbook, the profile page must be set to allow HTML by the page owner.</font><b><font color=red> THANK YOU for using Mywebsite.com! Please help spread the word! :)</font></b></td></tr><tr><td><textarea name="htmlcode" class="textinputs" style="border:solid 1px orange; overflow:hidden;" rows="4" cols="60" wrap="on" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();"><center><a href="' . $CONFIG["ecards_more_pic_target"] . (substr($CONFIG["ecards_more_pic_target"], -1) == '/' ? '' : '/') .basename($_SERVER['PHP_SELF']) . "?pos=-$CURRENT_PIC_DATA[pid]" . '" ><img src="' . $CONFIG["ecards_more_pic_target"] . get_pic_url($CURRENT_PIC_DATA, 'fullsize') . '" border="0"><br><a href="http://www.mywebsite.com">MyWebsite.com</a></center><br></textarea></td></tr>';




    $info['Embed URL'] .= '<tr><td style="height:15px;"></td></tr><tr><td><font color=orange>BBCode: (for bulletin board systems or sites that use BBCODE)</td></tr><tr><td><textarea name="bbcode" class="textinput" rows="4" cols="60" wrap="on" style="overflow:hidden;height:15px;" onfocus="this.select();" onclick="this.select();">) . "?pos=-$CURRENT_PIC_DATA[pid]" . '][​IMG]</textarea></td></tr>';


    $info['Embed URL'] .= '</table>';
    return $info;
    }

    // Add an install action
    $thisplugin->add_action('plugin_install','html_embed_install');

    // Install function
    function html_embed_install() {

    // Install
    if ($_POST['test']=='true')
    {
    return true;

    // Loop again
    } else {

    return true;
    }
    }

    ?>


    I do not have a clue how to do any of this! I am trying to find out how to change the url if this codebase.php is indeed the right file to do so.

    Thank you to everyone who took the time to read this!!!
     
    jbandp, Feb 21, 2010 IP
  2. ProtegeSales

    ProtegeSales Guest

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    By default you are altering the 'default' way that coppermine works.

    Just change:
    To:
     
    ProtegeSales, Feb 21, 2010 IP
  3. jbandp

    jbandp Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi Protege, Thank you for the response!

    I think I did this correctly and then I got this error code:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/recovery/public_html/plugins/bbcode/codebase.php on line 14

    Then I replaced the file with the backup I made so the site is on OK :)

    Any ideas what I may have done wrong? TY!
     
    jbandp, Feb 21, 2010 IP
  4. ProtegeSales

    ProtegeSales Guest

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Sorry. I didn't realize I had left the - in there.

    <a href="http://www.anotherwebsite.com/displayimage.php?pos=$CURRENT_PIC_DATA[pid]">  
    PHP:
    This 'should' work. If not, I'll just replicate it on my end and send it over. I was trying to avoid that, this is simple. :p
     
    ProtegeSales, Feb 21, 2010 IP
  5. jbandp

    jbandp Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sent you a PM. TYTY!
     
    jbandp, Feb 21, 2010 IP
  6. ProtegeSales

    ProtegeSales Guest

    Messages:
    88
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You're welcome. PM returned. :p
     
    ProtegeSales, Feb 21, 2010 IP