WordPress.org

Ready to get started?Download WordPress

Forums

sidebar links modifications to links.php? (19 posts)

  1. line
    Member
    Posted 8 years ago #

    This is my site i am working on porting to wordpress
    http://www.terminaldusk.com/dev/

    What i want to do with the links in the sidebar are as follows.

    1st. If there is an image associated with a link, like the 2 links under "upcoming releases". I would like the description to show as part of the link and not plain text.

    2nd. if there is no image like "current playlist" i would like the name and description to show, like it is. but there is no URL associated with "The Orb", i left the URL field blank, but it still shows as a link.

    Is there a way to not have "The Orb" be a link? an maintain everything mentioned above? I assume some editing to /includes/link.php would have to happen.

    can anyone help me accomplish this?

    thanks!
    Scott

  2. Tijmen
    Member
    Posted 8 years ago #

    Second one, very much possible. Go to links.php, line 244.

    There you see

    $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';

    This one creates the link. So put this around it:


    if ($the_link != "http://") {

    $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';

    }

    As for the first, still thinking about it...

  3. Tijmen
    Member
    Posted 8 years ago #

    Oops. Forget something. A few lines below the thing you just altered, there's another:

    $output .= '</a>';

    Do the same with that, so:

    if ($the_link != "http://") {
    $output .= '</a>';
    }

  4. Tijmen
    Member
    Posted 8 years ago #

    First thing also solved, also quite easy, but with some more changes. Better replace the whole stuff with this (from 244 down to where it says // endwhile, that is):

    if ($the_link != "http://") {
    $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
    }

    if (($row->link_image != null) && $show_images) {
    if (strstr($row->link_image, 'http')) {
    $output .= "<img src=\"$row->link_image\" $alt $title />";
    if ($show_description && ($desc != '')) {
    $output .= $between . $desc;
    }

    } else { // If it's a relative path
    $output .= "<img src=\"" . get_settings('siteurl') . "$row->link_image\" $alt $title />";

    if ($show_description && ($desc != '')) {
    $output .= $between . $desc;
    }
    }
    } else {
    $output .= $name;
    }

    if ($the_link != "http://") {
    $output .= '</a>';
    }

    if ($show_updated && $row->recently_updated) {
    $output .= get_settings('links_recently_updated_append');
    }

    if (($row->link_image != null) && $show_images) {
    if ($show_description && ($desc != '')) {
    $output .= $between . $desc;
    }
    }

    $output .= "$aftern";
    } // end while

  5. line
    Member
    Posted 8 years ago #

    I have placed all the code in from you last post and it has made my site go all out of wack.

    take a look: http://www.terminaldusk.com/dev/

    the first and second post worked, that third one made everything go haywire.

    thanks! maybe i implemented it wrong?
    does it mater if i have div's wrapping the upcoming releases ?

    thanks again!

    PS!!!!!

    I have link category upcoming releases set to generate:
    <div class="upcomingReleases"> before </div> after

    I have playlist set to generate:
    <li><strong> before
    </strong> :&nbsp; in between
    </li> after

  6. line
    Member
    Posted 8 years ago #

    this is the code being generated:

    <div id="sidebar">
    <li class="pagenav">
    <h2>Pages</h2>
    <ul>
    <li class="page_item"><a href="http://www.terminaldusk.com/dev/?page_id=2" title="About">About</a></li>
    </ul>
    </li>
    <h2>Upcoming Releases</h2>
    <div class="upcomingReleases">
    <a href="http://www.terminaldusk.com/discog/" title="TD004 : Wisp : Building Dragons"><img src="http://www.terminaldusk.com/images/releases/TD004_40x40.jpg" alt="TD004" title="TD004 : Wisp : Building Dragons">TD004 : Wisp : Building Dragons</a>TD004 : Wisp : Building Dragons
    <div class="upcomingReleases"><a href="http://terminaldusk.com/discog" title="TD003 : Line 47 / EmotionalJoystick : Meet Uptown"><img src="http://www.terminaldusk.com/images/releases/noImage_40x40.jpg" alt="TD003" title="TD003 : Line 47 / EmotionalJoystick : Meet Uptown">TD003 : Line 47 / EmotionalJoystick : Meet Uptown</a>TD003 : Line 47 / EmotionalJoystick : Meet Uptown
    <h2>Current Playlist</h2>
    <li><strong>Rusuden</strong></li>
    <li><strong><strong>V/A</strong></strong></li>
    <li><strong><strong><strong>[A]pendics Shuffle</strong></strong></strong></li>
    <li><strong><strong><strong><strong>Lackluster</strong></strong></strong></strong></li>
    <li><strong><strong><strong><strong><strong>V/A</strong></strong></strong></strong></strong></li>
    <li><strong><strong><strong><strong><strong><strong>Not Breathing</strong></strong></strong></strong></strong></strong></li>
    <li><strong><strong><strong><strong><strong><strong><strong>V/A</strong></strong></strong></strong></strong></strong></strong></li>
    <li><strong><strong><strong><strong><strong><strong><strong><strong>Shifted Phases</strong></strong></strong></strong></strong></strong></strong></strong></li>
    <li><strong><strong><strong><strong><strong><strong><strong><strong><strong>The Orb</strong></strong></strong></strong></strong></strong></strong></strong></strong></li>
    <li><strong><strong><strong><strong><strong><strong><strong><strong><strong><strong>Intricate</strong></strong></strong></strong></strong></strong></strong></strong></strong></strong></li>
    </div>

  7. Tijmen
    Member
    Posted 8 years ago #

    That's probably it, you haven't closed the div's. It's also strange you now have two descriptions on that page..

  8. line
    Member
    Posted 8 years ago #

    well i have not changed anything.
    I placed your code and now i have this???

    Im confused,

    i dont think it is placing the after code for the upcoming releases links, which is </div>

  9. Tijmen
    Member
    Posted 8 years ago #

    I was stupid I think, change the last

    if (($row->link_image != null) && $show_images) {

    in

    if (($row->link_image == null) && $show_images) {

    see if that works.

  10. Tijmen
    Member
    Posted 8 years ago #

    If I look at your code, you haven't closed the div's. That should help.

  11. line
    Member
    Posted 8 years ago #

    Im not sure what to do, i have placed the </div>
    in the after link?

    also it's not showing the descriptions for the playlist

  12. Tijmen
    Member
    Posted 8 years ago #

    Where in the code have you placed it?

  13. line
    Member
    Posted 8 years ago #

    in the admin, where you can specify what comes before, in between, and after a link

    Admin > Links > Link Categories
    on this page in the formatting section.

    :) thanks for helping me with this :)

  14. Tijmen
    Member
    Posted 8 years ago #

    Hah. Got it. The code pasted weirdly here, and $output .= "$aftern"; is supposed to be $output .= "$after n"; ...

    $after calls your </div>, not $aftern :)

  15. Tijmen
    Member
    Posted 8 years ago #

    Aaah. That space between after and n is supposed to be a backslash, which won't show up here...

  16. line
    Member
    Posted 8 years ago #

    ok that fixed the exploded page but it's still showing double
    $desc for upcoming releases and no $desc for current playlist

    here is the code it produces now

    <div id="sidebar">
    <li class="pagenav">
    <h2>Pages</h2>
    <ul>
    <li class="page_item"><a href="http://www.terminaldusk.com/dev/?page_id=2" title="About">About</a></li>
    </ul>
    </li>
    <h2>Upcoming Releases</h2>
    <div class="upcomingReleases"><a href="http://www.terminaldusk.com/discog/" title="TD004 : Wisp : Building Dragons"><img src="http://www.terminaldusk.com/images/releases/TD004_40x40.jpg" alt="TD004" title="TD004 : Wisp : Building Dragons">TD004 : Wisp : Building Dragons</a>TD004 : Wisp : Building Dragons</div>
    <div class="upcomingReleases"><a href="http://terminaldusk.com/discog" title="TD003 : Line 47 / EmotionalJoystick : Meet Uptown"><img src="http://www.terminaldusk.com/images/releases/noImage_40x40.jpg" alt="TD003" title="TD003 : Line 47 / EmotionalJoystick : Meet Uptown">TD003 : Line 47 / EmotionalJoystick : Meet Uptown</a>TD003 : Line 47 / EmotionalJoystick : Meet Uptown</div>
    <h2>Current Playlist</h2>
    <li>Lackluster</li>
    <li>Not Breathing</li>
    <li>V/A</li>
    <li>V/A</li>
    <li>Rusuden</li>
    <li>V/A</li>
    <li>The Orb</li>
    <li>Intricate</li>
    <li>Shifted Phases</li>
    <li>[A]pendics Shuffle</li>
    </div>

    Thanks! again! :)

    http://www.terminaldusk.com/dev/

  17. line
    Member
    Posted 8 years ago #

    I got it figured out! here is what the code ends up looking like from line 244 to // end while

    if ($the_link != "http://") {
    $output .= '<a href="' . $the_link . '"' . $rel . $title . $target. '>';
    }

    if (($row->link_image != null) && $show_images) {
    if (strstr($row->link_image, 'http')) {
    $output .= "<img src=\"$row->link_image\" $alt $title />";
    if ($show_description && ($desc != '')) {
    $output .= $between . $desc;
    }

    } else { // If it's a relative path
    $output .= "<img src=\"" . get_settings('siteurl') . "$row->link_image\" $alt $title />";

    if ($show_description && ($desc != '')) {
    $output .= $between . $desc;
    }
    }
    } else {
    $output .= $name . $between . $desc;
    }

    if ($the_link != "http://") {
    $output .= '</a>';
    }

    if ($show_updated && $row->recently_updated) {
    $output .= get_settings('links_recently_updated_append');
    }

    if (($row->link_image != null) && $show_images) {
    if ($show_description && ($desc != '')) {
    $output .= $between;
    }
    }

    $output .= "$after n";
    } // end while

  18. Tijmen
    Member
    Posted 8 years ago #

    Hurray! Great teamwork :)

  19. line
    Member
    Posted 8 years ago #

    Thanks! looks perfect! :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags