Results 1 to 7 of 7

Thread: Correct code for plugin / vba variable usage?

  1. #1

    Default Correct code for plugin / vba variable usage?

    I'm working on getting a thumbnail display to work in the adv_links_linkbit template. All my thumbnail names are the link id and '_t.jpg' appended to them. I have the template edited and is functioning as I want but I can't get the plugin I made to evaluate correctly. The plugin is:

    Code:
    $show['thumb_exists'] = file_exists('/home/mesing/public_html/links/link_images/14_t.jpg');
    The code evaluates true because the file 14_t.jpg exists and then evaluates false when I remove the image but what is the correct syntax to have the file name use the link id specified by $link[linkid] instead of the number 14? Is this even possible in a plugin? I hope I'm just tired and am missing some thing simple.

    Thanks,
    Last edited by PhilMcKrackon; 04-20-2008 at 11:04 PM.

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Correct code for plugin / vba variable usage?

    You would use this code to replace 14 with the linkid.
    PHP Code:
    $show['thumb_exists'] = file_exists('/home/mesing/public_html/links/link_images/' $link['linkid'] . '_t.jpg'); 
    vBa Links does not currently have any plugins though, so you would have to edit your forum/includes/functions_vba_links_cats.php file and add the code within the construct_linkbits() function.

  3. #3

    Default Re: Correct code for plugin / vba variable usage?

    Thanks Brian, I had tried that before and the code always evaluated as false even though the code that was original evaluates as true. I just did try a copy of what you posted to make sure I didn't have a typo and the code still evaluates false. I'm beginning to think that the variable $link[] cannot be used in a plugin. Is there anyway to see what a variable is in VB? I have looked all over the CP to see if there was some way of monitoring them while code was running.

    vBa Links does not currently have any plugins though, so you would have to edit your forum/includes/functions_vba_links_cats.php file and add the code within the construct_linkbits() function.
    For testing I applied the plugin to the 'global_start' hook location and this code in 'adv_links_linkbit'
    Code:
    <if condition="$show['thumb_exists']">
    <img src="/links/link_images/$link[linkid]_t.jpg"" border="1" onload="if (this.width>50) this.border=1; this.alt='$link[name]';"></a>
    <else />
    <img src="/links/link_images/no_thumb.jpg"" border="10" onload="if (this.width>50) this.border=1; this.alt='$link[name]';"></a>
    </if>
    works as long as I use the code for the plugin I posted. As long as I edit this '/home/mesing/public_html/links/link_images/14_t.jpg' in the plugin to 13_t.jpg or 12_t.jpg... The thumbnail shows for the link and all the links with out a thumbnail use the default thumbnail. It is only when I edit the plugin to reference the linkid that the plugin does not evaluate.

    Maybe I'm just not understanding this but I do appreciate the help.

  4. #4
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Correct code for plugin / vba variable usage?

    You cannot use a plugin for this. You would have to edit your forum/includes/functions_vba_links_cats.php file and add the code within the construct_linkbits() function.

  5. #5

    Default Re: Correct code for plugin / vba variable usage?

    Quote Originally Posted by Brian View Post
    You cannot use a plugin for this. You would have to edit your forum/includes/functions_vba_links_cats.php file and add the code within the construct_linkbits() function.
    That is what I thought, Thanks!

  6. #6

    Default Re: Correct code for plugin / vba variable usage?

    Sorry for the additional questions on this but I would like to do this same thing to the "ADV_LINKS_SHOWLINK" template, where the 'Description', 'Catagory', 'URL' and such tables are. Can you point me to wich section of what PHP file creates this?

    The last modification you directed me to worked great.

    Thanks,

  7. #7
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: Correct code for plugin / vba variable usage?

    You should be able to add the same code in your showlink.php file, just anywhere before the call to the ADV_LINKS_SHOWLINK template near the bottom.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Plugin error in Firefox when using Flash embed code
    By King-X in forum Troubleshooting & Problems
    Replies: 2
    Last Post: 08-06-2007, 02:04 PM
  2. .page CSS usage in adv_portal
    By led_belly in forum Feedback & Suggestions
    Replies: 1
    Last Post: 12-07-2005, 03:53 PM
  3. News Module Usage
    By Floob in forum "How Do I..." Questions
    Replies: 6
    Last Post: 10-08-2005, 08:18 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
  •