You are here

function follow_links_load in Follow 5

Same name and namespace in other branches
  1. 6 follow.module \follow_links_load()
  2. 7.2 follow.inc \follow_links_load()
  3. 7 follow.module \follow_links_load()

Loader function for individual links.

Parameters

$uid: An int containing the uid of the user. uid 0 pulls the site follow links.

Return value

A single link in array format, or FALSE if none matched the incoming ID.

2 calls to follow_links_load()
follow_links_form in ./follow.module
The form for editing follow links.
_follow_block_content in ./follow.module
Helper function to build the block content display.

File

./follow.module, line 578
Allows users to add links to their social network profiles.

Code

function follow_links_load($uid = 0) {
  $links = array();
  $sql = "SELECT * FROM {follow_links} WHERE uid = %d ORDER BY weight ASC";
  $result = db_query($sql, $uid);
  while ($link = db_fetch_object($result)) {
    $link->options = unserialize($link->options);
    $link->url = follow_build_url($link->path, $link->options);
    $links[$link->name] = $link;
  }
  return $links;
}