Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: Custom Fields != Image URLS ?

  1. #21
    Join Date
    Jul 2007
    Posts
    3

    Default Re: Custom Fields != Image URLS ?

    okay so i've got everything working fine in the showlinks page...

    but on the index page...the 5 latest and 5 most popular dont display any of the custom fields...

    this is my code on adv_links_linkbit
    <if condition="$vba_options['links_allowreplies']">
    <div style="font-size:11px;">
    $link[field2] | $link[field1]
    </div>
    <else />
    <span class="smallfont">$link[description]</span>
    </if>
    what am i doing wrong??

    - Statice

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

    Default Re: Custom Fields != Image URLS ?

    Looks like you've added part of the code twice, as the LEFT JOIN statement there is appearing twice.

    Make sure you're using this exact code:
    PHP Code:
            $querycols .= ', field1, field2';  
            
    $queryjoin .= ' LEFT JOIN ' TABLE_PREFIX 'adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)'

  3. #23
    Join Date
    Feb 2009
    Posts
    8

    Cool

    Brian, I tried this procedure but the images don't whos up. I'm sure i'm overlooking something (need some decent guides on these mods). What I get after applying the procedure described in here, is a DB Error:

    Code:
    Database error in vBulletin 3.8.4:
    
    Invalid SQL:
    SELECT links.linkid, name, description, linkurl, links.catid, username, links.userid, views, open, dateline, lastupdated, votenum, votetotal, customfields.*, posts, links.lastpostid, links.lastpostdateline, links.lastpostuserid, links.lastpostusername, NOT ISNULL(favorites.linkid) AS isfavorite, field5
                                            FROM vbut_adv_links AS links
                                             LEFT JOIN vbut_adv_links_cfields_entries AS customfields ON(links.linkid = customfields.lid) LEFT JOIN vbut_adv_links_favorites AS favorites ON (favorites.linkid = links.linkid AND favorites.userid = 1) LEFT JOIN vbut_adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)
                                            WHERE valid = 1
                                                    
                                            ORDER BY dateline DESC
                                            LIMIT 5;
    
    MySQL Error   : Not unique table/alias: 'customfields'
    Error Number  : 1066
    Request Date  : Monday, September 14th 2009 @ 02:46:14 PM
    Error Date    : Monday, September 14th 2009 @ 02:46:14 PM
    Script        : http://dev.mpcclub.com/links/
    Referrer      : http://dev.mpcclub.com/links/europe-based-3/
    IP Address    : 212.190.70.7
    Username      : Hi-Jack
    Classname     : vB_Database
    MySQL Version : 5.0.81-community
    Here's what I did:
    Editted the adv_link_linkbit template and tried placing the following in all position possible as a test:
    Code:
    <if condition="$link['field5']">
    <div style="float: left; padding-left: 4; padding-right: 8; padding-top: 3; padding-bottom: 3"><img border="0" src="$links[field5]" width="150" height="75"/></div>
    </if>
    I editted my links/index.php:
    right above:
    Code:
    $privcats = fetch_private_categories();
    i inserted:
    Code:
    $querycols .= ', field5';  
            $queryjoin .= ' LEFT JOIN ' . TABLE_PREFIX . 'adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)';
    Loading the page still works but i get the db error above...
    What I did is create a custom TEXT field where i enter the FULL HTTP URL of the image I want to show... I'd appreciate the help. Someone posted the error before but did not post the solution stating "working now" so i'm hopefully for this to work for me as well...

    In the end, i'd prefer even an IF clause that does not "render" the thumnail automatically if an image is selected here... like...

    if field5 is entered
    show image in field5
    else
    render auto thumbnail
    endif

    I would prefer reaching that kind of solution instead of showing an extra picture...

  4. #24
    Join Date
    Feb 2009
    Posts
    8

    Default

    And an update...
    Despite following the previous guides to the letter and not coming to a solution, i found the tip about changing the linkurl to the field where you'd enter the screenshot. This works however not as described.

    Description: Create a custom field where you enter the URL to the page you want to take the screenshot from.

    When doing so and edit the link to have this URL field, it is stored in the DB between BB tags and therefore does not function. I did the same thing as described but created a selection list instead as custom field with the URLS I need selecteable and this worked flawless...

    I'd still wish for a better solution (see above) where the routine is changed in an If Then Else procedure...

  5. #25
    Join Date
    Feb 2009
    Posts
    8

    Default

    I feel as i'm coming over impatient but trust me, i'm not :-)
    Ok, what I did to break loose from the fact I could not enter files and add a custom URL is as follows, adjusting both templates for the linkbits and showbits templates. Custom Field: field5 (in your case, change 5 to whatever ID you have assigned to your custom field)

    - adminCP -> Style - Edit Templates -> vBadvanced Links Directory Templates -> adv_links_linkbit

    Changed:
    Code:
    "<if condition="$show['nofollow']"> rel="nofollow"</if>><img alt="$link[name_nohighlight]" src="http://open.thumbshots.org/image.aspx?url=$link[linkurl]" width="120" height="90" border="0" /></a>
    To:
    Code:
    "<if condition="$show['nofollow']"> rel="nofollow"</if>><img alt="$link[name_nohighlight]" src="http://open.thumbshots.org/image.aspx?url=$link[field5]" width="120" height="90" border="0" /></a>
    - adminCP -> Style - Edit Templates -> vBadvanced Links Directory Templates -> adv_LINKS_SHOWLINKS

    Changed:
    Code:
    <if condition="$show['nofollow']"> rel="nofollow"</if>><img alt="$link[name_nohighlight]" src="http://open.thumbshots.org/image.aspx?url=$link[linkurl]" width="120" height="90" border="0" /></a></td>
    		</if>
    TO:
    Code:
    <if condition="$show['nofollow']"> rel="nofollow"</if>><img alt="$link[name_nohighlight]" src="http://open.thumbshots.org/image.aspx?url=$link[field5]" width="120" height="90" border="0" /></a></td>
    		</if>
    Now it won't work like this just because the URL you enter is stored in the DB with BB Tags (adv_links_cfields_entries like:
    Code:
    [ url ]link[ /url ]
    .

    We created a little script for this that can be ran at any time manually or propbably can be scheduled in cron and removes these BBCode parts of this specific field only so links become properly stored without bbcode tags and can be used by the system. Then it works on both the list and details view to add a custom URL to your links directory.

    In case you enter websites, you have to enter the address twice, once for the link and once for the screenshot were in case of files, you can add the file link for download and set any URL it needs to take a screenshot from.

    That did it and felt better than editting whatever pages necessary. This makes it more easy to upgrade later on as well as we only changes two soft keys in the templates.

    Hope it helps someone else as well.

    Brian:
    I would dare hope custom images will become supported eventually and an option in Setup is provided to select whatever custom field should be used as a thumbshots target. In addition, the entry of text fields should be stored "exactly" as the user enters it for these custom fields and not changed into bbcode. It would expand the useability of this tool so much it can be used for all kinds and files and not just links. That's where it would become "advanced" as the currently it's not im my humble opinion. It took me a little by surprise... but we got to the finish line eventually and hope for the best in the future...

    I appreciate your endless efforts up here and providing these great tools and hope you'll make use of more potential in the future...
    Last edited by Hi-Jack; 09-15-2009 at 02:45 AM.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 07-10-2005, 05:37 PM
  2. Incorrect Image and Active Member Link URLs
    By zylstra in forum Troubleshooting / "How do I..." Questions
    Replies: 5
    Last Post: 10-11-2004, 05:34 PM
  3. Custom Fields
    By suttercane in forum "How Do I..." Questions
    Replies: 2
    Last Post: 09-28-2004, 06:08 PM
  4. RC3 - Custom Fields?
    By Allen Mead in forum "How Do I..." Questions
    Replies: 3
    Last Post: 08-17-2004, 07: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
  •