1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Caffeinated Content template

Discussion in 'Cloaking and Content Generators' started by Volguuz, Apr 15, 2009.

  1. Volguuz

    Volguuz Newbie

    Joined:
    Feb 16, 2009
    Messages:
    11
    Likes Received:
    0
    Hey guys, got a simple question.

    I have caffeinated content v3.37 on wp 2.21 and i noticed the rewriting options we have by editing the tempaltes and i'm wondering, does anyone know how to set a link to the image that is added with the post by the plugin?'

    Thank you.
     
  2. blackhat+er

    blackhat+er Regular Member

    Joined:
    Feb 19, 2009
    Messages:
    217
    Likes Received:
    150
    Omg dude why are you using version 2.21 unless its custom lightweight. You know they have version 2.71 just go to wordpress.org and you can dl it. Then you just unzip it and ftp all the files to your directory and allow it to overwrite the exisiting files and your good. You wont have any issues with cc after that.
     
  3. Volguuz

    Volguuz Newbie

    Joined:
    Feb 16, 2009
    Messages:
    11
    Likes Received:
    0
    Sorry man i just mistyped it, 2.71 i got the latest of wordpress.

    Anw can someone give me some ligths on my question about CC please?

    Thank you.
     
  4. geezer101

    geezer101 Junior Member

    Joined:
    Mar 15, 2009
    Messages:
    139
    Likes Received:
    121
    Location:
    UK
    It would be easy to add the same link to every image, but not sure how you'd add a unique link for each one. So, using the default post template:

    Code:
    <div style="float:left; padding: 12px"><a href="http://www.yourlink.com">[image]</a></div><div><br/><br/>[video]<br/>[post]<br/><br/>[link]</div>
    Give that a go and see what happens? At the moment it links to a "full size" image, which of course is still the same thumbnail, so not sure if the above code would break that link, or what, so give it a go. I guess if you wanted to change the link, you could post x amount of articles, edit the template, change the link, then post more, and repeat..
     
  5. Volguuz

    Volguuz Newbie

    Joined:
    Feb 16, 2009
    Messages:
    11
    Likes Received:
    0
    Thanks alot man, actually i didn't want a unique link for each but what you just showed me haha.

    Again thank you:D
     
  6. Volguuz

    Volguuz Newbie

    Joined:
    Feb 16, 2009
    Messages:
    11
    Likes Received:
    0
    Well man i've just tried it and although it posts the link i introduced in the post html code the image still remains linked to the full image (thumbnail).

    Here's how the html looks:

    <div style="float:left; padding: 12px"><a href="hxxp://*****.****.***/"></a><a href="/wp-content/uploads/2009/04/******160.jpg"><img src="/wp-content/uploads/2009/04/*****160.jpg" alt="" /></a></div>
    <div>

    and this is the code i have on the template:

    <div style="float:left; padding: 12px"><a href="hxxp://*******.***/">[image]</a></div><div>
    <p>[post]<br/>
    </p>
    <p>[link]</p>
    </div>

    What do you suggest mate?

    Thanks
     
  7. geezer101

    geezer101 Junior Member

    Joined:
    Mar 15, 2009
    Messages:
    139
    Likes Received:
    121
    Location:
    UK
    Ah, ok.. well open up functions.php in an editor if you have one, or notepad etc.

    If you are using 3.3.7 go to line 1924, or search for [image] and you will see this line of code

    Code:
    $post['post_content'] = str_replace("[image]", "<a href=\"$file_url\"><img src=\"$thumb_url\" title='$img_title' alt='$img_title' /></a>", $post['post_content']);
    Now simply replace the hyperlink to the url you want, so it would be:

    Code:
    $post['post_content'] = str_replace("[image]", "<a href="http://www.yoursite.com"><img src=\"$thumb_url\" title='$img_title' alt='$img_title' /></a>", $post['post_content']);
    Then reupload back to the server. Remember to remove the link from the template file though, in case that adds it in twice.
     
  8. Volguuz

    Volguuz Newbie

    Joined:
    Feb 16, 2009
    Messages:
    11
    Likes Received:
    0
    Geezer101 thank you for your help, i just did what you mentioned and my line stays like this:

    $post['post_content'] = str_replace("[image]", "<a href="****.1se***tt.h**.******.n0t"><img src=\"$thumb_url\" title='$img_title' alt='$img_title' /></a>", $post['post_content'

    but i get an error:

    Parse error: syntax error, unexpected T_STRING in /home/****/public_html/****/wp-content/plugins/CaffeinatedContent/functions.php on line 2000

    the line is the 2000th and i even removed the "hxxp://" as the code in dreamweaver changed color as i believe it has to do with the syntax structure, suposedly the "" should contain the url and not affect the rest of the code but i don't think it's doing it... not really sure how to change the code.

    thanks again man:)
     
  9. geezer101

    geezer101 Junior Member

    Joined:
    Mar 15, 2009
    Messages:
    139
    Likes Received:
    121
    Location:
    UK
    Hmm tha should be a simple problem, like a missing " or } or ; in that line. Open the file with notepad instead of dreamweaver, as that may mess the code up. Once in notepad check that the entire line is how i wrote it in the example above. Make sure http:// is included and also make sure to put quote marks around the url. PM if you get stuck