kunzite (kunzite1) wrote in component_help,
kunzite
kunzite1
component_help

[theme] - [component] - [friend filter redirect]

takes in livejournal siteroot, livejournal username, friend filter name, and redirects to the patched together url.
###################################
#      FRIEND FILTER REDIRECT     #
# kunzite1, component_help/875677 #
# add to print_free_text(Page p)  #
###################################
var string   k1FFRheader       = "friend filter redirect";                               # component header
var string   k1FFRsubmit       = "filter!";                                              # label for submit button
var string   k1FFRscript_url   = "http://mike.mm1swebcreations.com/lj/c_h/ljsearch.php"; # script url

var string[] k1FFRfilter_names = [""];
var string[] k1FFRfilter_texts = [""];
var int      k1FFRfilter_index = 0;

# set one
$k1FFRfilter_names[$k1FFRfilter_index] = "?show=y";     # string to append to /users/exampleusername/friends/
$k1FFRfilter_texts[$k1FFRfilter_index] = "syndication"; # string to be used for option text
$k1FFRfilter_index++;

# set two
$k1FFRfilter_names[$k1FFRfilter_index] = "lj+client+journals"; # string to append to /users/exampleusername/friends/
$k1FFRfilter_texts[$k1FFRfilter_index] = "LJ Client Journals"; # string to be used for option text
$k1FFRfilter_index++;

# set three
$k1FFRfilter_names[$k1FFRfilter_index] = "lj+communities"; # string to append to /users/exampleusername/friends/
$k1FFRfilter_texts[$k1FFRfilter_index] = "LJ Comms";       # string to be used for option text
$k1FFRfilter_index++;

print_comp_header($k1FFRheader);
"""
<form name="form" id="form" method="post" action="$k1FFRscript_url">
  <input type="hidden" name="mode"       value="ljff" />
  <input type="hidden" name="siteroot"   value="$*SITEROOT" />
  <input type="hidden" name="ljusername" value="$p.journal.username" />
  <select name="query" id="query">""";
foreach var int i (0 .. size($k1FFRfilter_names) - 1) {
"""
    <option value="$k1FFRfilter_names[$i]">$k1FFRfilter_texts[$i]</option>""";
}
"""
  </select>
  <input type="submit" value="$k1FFRsubmit" />
</form>""";
print_comp_footer();
Tags: !tutorial, function: print_free_text, user: kunzite1
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic
  • 5 comments