Page 1 of 2 12 LastLast
Results 1 to 20 of 25

Thread: Custom Fields != Image URLS ?

  1. #1
    Join Date
    Nov 2005
    Posts
    127

    Default Custom Fields != Image URLS ?

    I've tried adding a custom field to my "adv_links_linkbit" template with no luck. What I'm trying to do is add:

    Code:
    <div style="float: left; padding-left: 4; padding-right: 8; padding-top: 3; padding-bottom: 3"><img border="0" src="$links[field3]" width="150" height="75"/></div>
    To my postbit. Where field3 is a URL to a banner. All I get though is a red X. Was wondering how I can fix the red X issue and add a conditional that if field3 = blank then display X.

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

    Default Re: Custom Fields != Image URLS ?

    <if condition="$link['field3']"> </if>

  3. #3
    Join Date
    Nov 2005
    Posts
    127

    Default Re: Custom Fields != Image URLS ?

    I tired that and for some reason it doesn't work.

    I've got. A custom profile field3 where users can enter a URL to an image.

    <if condition="$link['field3']">
    <img border="0" src="$links[field3]" width="150" height="75"/>
    </if>
    However, nothing shows up when I use the if conditional and if I don't use the if conditional all I get is a red X.

    Correction, I can see the banner when accessing browselinks.php, or viewing a directory, however on the index.php I get red X's.
    Last edited by Shelby; 01-03-2007 at 06:32 AM.

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

    Default Re: Custom Fields != Image URLS ?

    You'd need to modify your index.php file so that the new and random links sections will also pull the custom fields. If you look in that file for this code:
    PHP Code:
    $querycols implode(', '$querycols); 
    And add this right Above it:
    PHP Code:
            $querycols[] = 'field3';
            
    $queryjoin .= ' LEFT JOIN ' TABLE_PREFIX 'adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)'
    Then that should do the trick.

  5. #5
    Join Date
    Nov 2005
    Posts
    127

    Default Re: Custom Fields != Image URLS ?

    Sweet.

  6. #6
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    This didn't work for me. I still get the red x. Probably because the following code is not in my index.php file:

    $querycols = implode(', ', $querycols);

    I searched and did *not* find it. Any help?

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

    Default Re: Custom Fields != Image URLS ?

    Search for this code instead:
    PHP Code:
    $privcats fetch_private_categories(); 
    And then add this right above:
    PHP Code:
            $querycols .= ', field3'
            
    $queryjoin .= ' LEFT JOIN ' TABLE_PREFIX 'adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)'

  8. #8
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    Thank you for your reply

    But I still get the red x. Also, the logo just kind of squeezes itself into the link name column. Is there a way I can add a column for the logo?

    The most important thing is to solve that red x. The images aren't showing. Could it be that I haven't pasted this code in the correct place of the adv_links_linkbit? It wasn't specified where to put it:

    Code:
    <if condition="$link['field1']">
    <img border="0" src="$links[field1]" width="150" height="75"/>
    </if>

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

    Default Re: Custom Fields != Image URLS ?

    Does the image appear correctly when viewing a link? You don't seem to have anything entered for any custom fields in the link on your site...

  10. #10
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    It doesn't show when viewing the link either.

    I setup a custom field. It's there. Not sure what you mean.

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

    Default Re: Custom Fields != Image URLS ?

    You have to actually add the URL to the image in that field when submitting/editing a link.

  12. #12
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    Into the custom field? That's what I'm doing. I'm getting a red x.

    Is that what you mean??

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

    Default Re: Custom Fields != Image URLS ?

    Edit the link that you've submitted, and add the URL to your image in the place for the custom field you've added. Otherwise, if there's nothing entered, then there's nothing to display.

  14. #14
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    As I've said, that data *is* entered. In the custom field which I created for banners and logos, I have placed the URL to the *image*. Red box.

    I have done everything in this thread. You never answered the question about the placement of the code and if that has anything to do with the problem.

    I don't know why I'm getting red x for images. They are there, but they are not showing up on browselinks.php, index, or the link details.

  15. #15
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    Here just look at the links for yourself.

    http://tsw.kaystreet.net/links

  16. #16
    Join Date
    Jun 2006
    Posts
    9

    Default Re: Custom Fields != Image URLS ?

    Help?

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

    Default Re: Custom Fields != Image URLS ?

    Check your PMs.

  18. #18
    Join Date
    Jul 2007
    Posts
    3

    Default Re: Custom Fields != Image URLS ?

    Hi, i just tried this mod...got it working perfectly...

    then i refreshed like 2minutes later and got a database error..

    Code:
    Invalid SQL:
    SELECT links.linkid, name, description, linkurl, links.catid, username, links.userid, views, open, dateline, votenum, votetotal, NOT ISNULL(subscribelink.linkid) AS subid, posts, links.lastpostid, links.lastpostdateline, links.lastpostuserid, links.lastpostusernamefield1field2
    					FROM adv_links AS links
    					 LEFT JOIN adv_links_subscribelink AS subscribelink ON (links.linkid = subscribelink.linkid AND 1 = subscribelink.userid)  LEFT JOIN adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid) LEFT JOIN adv_links_cfields_entries AS customfields ON (links.linkid = customfields.lid)
    					WHERE valid = 1 AND suspended = 0 
    					ORDER BY dateline DESC
    					LIMIT 5;
    
    MySQL Error  : Not unique table/alias: 'customfields'

  19. #19
    Join Date
    Jul 2007
    Posts
    3

    Default Re: Custom Fields != Image URLS ?

    hmm ...

    i just took out the code from index.php and i went back in to see what fields were missing...

    and they were all there still...how is that possible?


    sorry for another edit....

    okay so i've got everything working fine in the categories...
    but on the main page...the 5 latest and 5 most popular dont display any of the custom fields...

    can i edit that somewhere?

    Thanks,
    Statice
    Last edited by Statice; 07-24-2007 at 01:35 AM.

  20. #20
    Join Date
    Jul 2007
    Location
    London UK
    Posts
    30

    Default Re: Custom Fields != Image URLS ?

    Can I ask the location in the adv_links_linkbit code - the proceeding line - to which this code was added.

    Cheers Roy




    Quote Originally Posted by Shelby View Post
    I've tried adding a custom field to my "adv_links_linkbit" template with no luck. What I'm trying to do is add:

    Code:
    <div style="float: left; padding-left: 4; padding-right: 8; padding-top: 3; padding-bottom: 3"><img border="0" src="$links[field3]" width="150" height="75"/></div>
    To my postbit. Where field3 is a URL to a banner. All I get though is a red X. Was wondering how I can fix the red X issue and add a conditional that if field3 = blank then display X.

Page 1 of 2 12 LastLast

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, 04: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, 04:34 PM
  3. Custom Fields
    By suttercane in forum "How Do I..." Questions
    Replies: 2
    Last Post: 09-28-2004, 05:08 PM
  4. RC3 - Custom Fields?
    By Allen Mead in forum "How Do I..." Questions
    Replies: 3
    Last Post: 08-17-2004, 06: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
  •