## ## ## Link Up Gold ## ## http://www.phpwebscripts.com/ ## ## e-mail: info@phpwebscripts.com ## ## ## ## ## ## version: 3.05 ## ## copyright (c) 2005 ## ## ## ## This script is not freeware nor shareware ## ## Please do no distribute it by any way ## ## ## ################################################# include('./common.php'); get_messages('link.php'); if (($s[A_option]=='rewrite') AND ($_GET[vars])) $_GET = rewrite_item($_GET[vars]); if (($_GET[action]=='next') OR ($_GET[action]=='previous')) $in = prev_next_detail_page('l',$_GET); elseif (is_numeric($_GET[n])) $in = $_GET; else problem($m[no_link]); $q = dq("select * from $s[pr]links where number = '$in[n]' limit 1",0); $a = mysql_fetch_assoc($q); if (!$a[number]) problem($m[link_n_ex]); if (check_admin_for_links($a[category])) $a[edit_table] = admin_link_edit_table($in[n]); // musi byt nahore kvuli obrazku $usit = user_defined_items_display('l',$all_user_items_list,$all_user_items_values,$in[n],'user_item_listing.txt',0,1); $a[user_defined] = $usit[$in[n]]; foreach ($usit['individual_'.$in[n]] as $k1=>$v1) $a[$k1] = $v1; $a[count_url] = "$s[phpurl]/link_click_out.php?action=free_link&n=$a[number]&url=".urlencode($a[url]); if ($a[button]) { $a[image] = ''; $a[image_click_top] = ''; $a[image_click_blank] = ''; } else $a[image] = $a[image_click_top] = $a[image_click_blank] = ''; $a[icon] = get_icons_for_item('l',$a); $a[added] = datum($a[added],0); if ($a[updated]) $a[updated] = datum($a[updated],0); else $a[updated]='-'; $rating = round(($a[rating]*2)); if ($rating) $a[rateicon] = ""; else $a[rateicon] = ''; if (strstr($a[detail],'')) $a[link] = $a[detail]; elseif ($a[url]) $a[link] = ''.$a[title].''; else $a[link] = ''.$a[title].''; if ($s[det_br]) $a[detail] = str_replace("\n",'',$a[detail]); //$a[detail] = str_replace(''',"'",$a[detail]); $x = list_of_categories_for_item('l',0,$a[c],'',0); $a = array_merge((array)$a,(array)$x); if ($a[comments]) $a[show_comments] = get_comments_for_one_item('l',$in[n],0); $template = get_detail_template_name('l',$a[c]); $a[more_links] = more_items_of_author('l',$a[email],0); $a[ratings_table] = rating_table('l',$a[number],0); if ($s[LUG_u_username]) { $a[add_delete_favorites] = get_favorite_line('l',$in[n]); if (!$a[private_notes_display] = get_private_notes_for_item('l',$in[n])) $a[private_notes_display] = ''.$m[add_notes].' '.$m[link].''; } if ($in[category_name]) { $a[category_name] = $in[category_name]; $a[category] = $in[c]; } page_from_template($template,$a); ############################################################################# ############################################################################# ############################################################################# function check_admin_for_links($category) { global $s; if (check_admin_rights('alllinks')) return 1; if (!$_SESSION[admuser]) return 0; $q = dq("select category from $s[pr]mod_cats where username = '$_SESSION[admuser]'",1); while ($x = mysql_fetch_array($q)) { if ($category == $x[0]) return 1; } return 0; } ############################################################################# function admin_link_edit_table($number) { global $s; include ($s[phppath].'/functions_admin.php'); $q = dq("select * from $s[pr]links where number = '$number'",1); $link = mysql_fetch_assoc($q); $q = dq("select * from $s[pr]usit_values where use_for = 'l' AND number = '$number'",1); while ($x = mysql_fetch_assoc($q)) { $link['user_item_'.$x[item_number]][code] = $x[value_code]; $link['user_item_'.$x[item_number]][text] = $x[value_text]; } $return = ''; $return .= link_create_edit_form_for_admin($link); $return .= ''; return $return; } ############################################################################# function link_create_edit_form_for_admin($link) { global $s; $n = $link[number]; $link = stripslashes_array($link); for ($x=0;$x<=5;$x++) { if ($link[pick]==$x) $pick[$x] = ' selected'; } $return = ' Edit This Link (This form is visible to admin) '; $return .= " Link number: $n"; $return .= " URL Recip URL $link[i_recip] Title Description Detailed entry $link[detail]"; if ($link[q_number]) $link[number] = $link[q_number]; // queue $return .= categories_rows_form_for_admin('l',$link); $link[action] = 'link_edit'; $return .= user_defined_items_form_for_admin('l',$link); $return .= "Webmaster name Email Picture Picture size Width Height "; if ($link[button]) $return .= ' Current picture '; $return .= ' Password '; $return .= ' Valid From '.get_date_select_for_admin($link[t1],'link['.$n.'][t1]').'To '.get_date_select_for_admin($link[t2],'link['.$n.'][t2]').' Editor\'s Pick No12 345 Rating Votes Hits in Hits out Link is enabled '; $return .= ''; return $return; } ############################################################################# ############################################################################# ############################################################################# ?>