You are here

function follow_links_load in Follow 6

Same name and namespace in other branches
  1. 5 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.

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

File

./follow.module, line 763
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;
}