Results 1 to 14 of 14

Thread: vBA CMS: add an image beside your links in navigation module

  1. #1

    Lightbulb vBA CMS: add an image beside your links in navigation module

    Version: 1.0.0
    vB Version: 3.5.2
    Assuming that you have vBAdvanced Version: 2.1.0 installed.

    Description:add an image beside your links in navigation module
    Details: 1 Template Edit and 1 File Edit.
    Difficulty: easy.

    Author: Milad

    Installation:

    1. In includes/adminfunctions_vba_cmps.php

      1. Find:

        PHP Code:
        $inputs .= '<tr><td><input class="bginput" name="' $name '[' $pagecount '][order]" value="' $navlinks['order'] . '" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][level]" value="' $navlinks['level'] . '" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][link]" value="' $navlinks['link'] . '" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][text]" value="' $navlinks['text'] . '" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td></tr>'
        Replace with:

        PHP Code:
        $inputs .= '<tr><td><input class="bginput" name="' $name '[' $pagecount '][order]" value="' $navlinks['order'] . '" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][level]" value="' $navlinks['level'] . '" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][link]" value="' $navlinks['link'] . '" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][text]" value="' $navlinks['text'] . '" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][image]" value="' $navlinks['image'] . '" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td></tr>'
      2. Find:

        PHP Code:
        $inputs .= '<tr><td><input class="bginput" name="' $name '[' $pagecount '][order]" value="" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][level]" value="" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][link]" value="" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][text]" value="" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td></tr>'
        Replace with:

        PHP Code:
        $inputs .= '<tr><td><input class="bginput" name="' $name '[' $pagecount '][order]" value="" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][level]" value="" size="1" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][link]" value="" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][text]" value="" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td><td><input class="bginput" name="' $name '[' $pagecount '][image]" value="" size="20" ' iif($type == 'page''onclick="' $jsdefault '"') . '/></td></tr>'
      3. Find:

        PHP Code:
        print_description_row($description '<br /><table align="center" cellpadding="4" cellspacing="0" class="tborder"><tr><td class="thead">' $vbphrase['order'] . '</td><td class="thead">' $vbphrase['level'] . '</td><td class="thead">' $vbphrase['link'] . '</td><td class="thead">' $vbphrase['text'] . '</td></tr>' $inputs '</table>'); 
        Replace with:

        PHP Code:
        print_description_row($description '<br /><table align="center" cellpadding="4" cellspacing="0" class="tborder"><tr><td class="thead">' $vbphrase['order'] . '</td><td class="thead">' $vbphrase['level'] . '</td><td class="thead">' $vbphrase['link'] . '</td><td class="thead">' $vbphrase['text'] . '</td><td class="thead">' $vbphrase['image'] . '</td></tr>' $inputs '</table>'); 

    2. In adv_portal_navigationbits template find:

      [html]$navmark[/html]

      Replace with:

      [html]<if condition="$navlinks[image]"><img src="$navlinks[image]" alt="$title" align="middle" /><else />$navmark</if>[/html]
    3. Edit your "Site Navigation" module and add an image's URL for every link (or page) you want. Be noticed: "Image" field is optional.
    4. Click to receive updates.
    5. Done! Thank you for installing.


    Changelog:
    • Feb, 27th 2006: (1.0.0)
      • Initial release


    Support is free-time controlled.

  2. #2
    Join Date
    Feb 2006
    Posts
    2

    Default Re: vBA CMS: add an image beside your links in navigation module

    Thanks i love it

  3. #3
    Join Date
    Nov 2005
    Posts
    5

    Default Re: vBA CMS: add an image beside your links in navigation module

    nice work thanks

  4. #4

    Default Re: vBA CMS: add an image beside your links in navigation module

    In adv_portal_navigationbits template find:

    [html]$navmark[/html]

    Replace with:

    [html]<if condition="$navlinks[image]"><img src="$navlinks[image]" alt="$title" align="middle" /><else />$navmark</if>[/html]


    for the latest vbadvanced do this :

    In adv_portal_navigationbits template find:

    $navmark

    Replace with:

    <if condition="$navlinks[image]"><img src="$navlinks[image]" alt="$title" align="middle" /><else />$navmark</if>
    Last edited by necronomicon; 05-01-2007 at 04:53 AM.

  5. #5
    Join Date
    Apr 2008
    Posts
    1

    Default Nice!

    Nice posting.. thank you!

    Mike @ cmscritic.com

  6. #6

    Default

    does this work for vB 3.7?

  7. #7
    Join Date
    Sep 2007
    Posts
    5

    Default

    includes/adminfunctions_vba_cmps.php
    A file with this name is not existing in vB 3.6.4...
    ergo: installation cancelled.

  8. #8
    Join Date
    May 2008
    Location
    Sarasota, Florida
    Posts
    302

    Default

    Quote Originally Posted by tobaro View Post
    A file with this name is not existing in vB 3.6.4...
    ergo: installation cancelled.
    You really should upgrade your forum. A lot of important updates have been released since that version.

  9. #9
    Join Date
    Jan 2010
    Posts
    4

    Default

    Could someone give me a guide for the latest version of vBadvanced CMS?

  10. #10
    Join Date
    Jan 2011
    Posts
    1

    Default

    Wow thanks alot dude! It works totally fine!!!

  11. #11

    Default

    Using:
    vB 4.1.0
    vBa CMPS 4.0.1

    I managed to edit my includes/vba_cmps_adminfunctions.php (name slightly different from older versions) successfully so that I now have Image fields in my Site Navigation module, yay!

    Having trouble with the adv_portal_navigationbits template, though.

    My current template:

    <div>{vb:raw navmark} <vb:if condition="$link"><a href="{vb:raw link}"<vb:if condition="$native == 0"> target="_blank"</vb:if>>{vb:raw title}</a><vb:else />{vb:raw title}</vb:if></div>

    Could someone please incorporate his instructions into this for me, since they are for an older version? I've tried, but it's just too greek to me.

    Thanks a bunch!
    Last edited by JellyBean3350; 03-06-2011 at 04:12 PM.

  12. #12

    Default

    Was able to make this work for vB 4 and vBA CMPS 4.0.1. Note: I haven't upgraded to the most recent version of CMPS yet.

    This will add Image fields in your Admin CP/vBa CMPS/Edit Modules/Site Navigation, as follows:



    Edit vba_cmps_adminfunctions.php (via ftp: /forum/includes/vba_cmps_adminfunctions.php) in two places, as follows:

    1. Find:
    PHP Code:
    $inputs .= '<tr>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][order]" value="' $navlinks['order'] . '" size="2" tabindex="1" ' $jsdefault_onchange '/></td>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][level]" value="' $navlinks['level'] . '" size="2" tabindex="1" ' $jsdefault_onchange '/></td>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][link]" value="' $navlinks['link'] . '" size="26" tabindex="1" ' $jsdefault_onchange '/></td>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][text]" value="' htmlspecialchars($navlinks['text']) . '" size="18" tabindex="1" ' $jsdefault_onchange '/></td></tr>'

    Replace with:
    PHP Code:
    $inputs .= '<tr>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][order]" value="' $navlinks['order'] . '" size="2" tabindex="1" ' $jsdefault_onchange '/></td>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][level]" value="' $navlinks['level'] . '" size="2" tabindex="1" ' $jsdefault_onchange '/></td>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][link]" value="' $navlinks['link'] . '" size="26" tabindex="1" ' $jsdefault_onchange '/></td>
                                        <td><input class="bginput" name="' 
    $name '[' $pagecount '][image]" value="' $navlinks['image'] . '" size="18" tabindex="1" ' $jsdefault_onchange '/></td>
    <td><input class="bginput" name="' 
    $name '[' $pagecount '][text]" value="' htmlspecialchars($navlinks['text']) . '" size="18" tabindex="1" ' $jsdefault_onchange '/></td></tr>'

    2. Find:
    PHP Code:
    print_label_row($description'
                                <table align="right" cellpadding="2" cellspacing="0" class="tborder">
                                    <tr>
                                        <td class="thead">' 
    $vbphrase['order'] . '</td>
                                        <td class="thead">' 
    $vbphrase['level'] . '</td>
                                        <td class="thead">' 
    $vbphrase['link'] . '</td>
                                        <td class="thead">' 
    $vbphrase['text'] . '</td>
                                    </tr> 

    Replace with:
    PHP Code:
    print_label_row($description'
                                <table align="right" cellpadding="2" cellspacing="0" class="tborder">
                                    <tr>
                                        <td class="thead">' 
    $vbphrase['order'] . '</td>
                                        <td class="thead">' 
    $vbphrase['level'] . '</td>
                                        <td class="thead">' 
    $vbphrase['link'] . '</td>
                                        <td class="thead">' 
    $vbphrase['image'] . '</td>
                                        <td class="thead">' 
    $vbphrase['text'] . '</td>                                                      
                                       </tr> 

    --------------------------

    Edit navigation.php (via ftp: /forum/modules/navigation.php) in two places, as follows:

    1. Find:
    PHP Code:
    $title $navlinks['text']; 

    Replace with:
    PHP Code:
    $title $navlinks['text'];
    $image $navlinks['image']; 

    2. Find:
    PHP Code:
    $templater->register('title'$title); 

    Replace with:
    PHP Code:
    $templater->register('title'$title);
    $templater->register('image'$image); 

    --------------------------

    Edit adv_portal_navigationbits template, as follows:

    Code:
    <div><vb:if condition="$image"><img src="{vb:raw image}" alt="{vb:raw title}" align="top" vspace="1" /><vb:else />{vb:raw navmark}</vb:if> <vb:if condition="$link"><a href="{vb:raw link}"<vb:if condition="$native == 0"> target="_blank"</vb:if>>{vb:raw title}</a></vb:if></div>
    Please note that my adv_portal_navigationbits template is written so that links to anything outside of my site open in a new window/tab. Use align and vspace (vertical space) to adjust alignment of the images.

    You should now have Image fields in your Admin CP when editing your Site Navigation module. Just input a relative path to your image. Example: /forum/images/custom/image.png

    That's it!

  13. #13
    Join Date
    Jun 2010
    Posts
    4

    Default

    any chance someone can explain how to do this on the newest version of vBA CMS?

  14. #14

    Default

    Sorry for bumping an old thread but any chance this can be updated for the newest version?

    Thanks very much,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Please. html Links in Site Navigation Module
    By karrerax in forum "How Do I..." Questions
    Replies: 2
    Last Post: 10-16-2005, 11:40 PM
  2. Open Links in New Window (Site Navigation Module)
    By matmen in forum "How Do I..." Questions
    Replies: 1
    Last Post: 07-22-2005, 08:43 PM
  3. Adding Custom Links in Site Navigation Module
    By MBM in forum Troubleshooting & Problems
    Replies: 4
    Last Post: 06-23-2005, 08:09 PM
  4. Create A module for Image Links?
    By RaceJunkie in forum "How Do I..." Questions
    Replies: 42
    Last Post: 06-21-2005, 05:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •