/********************************************************************************/
/* EasyBookMarker: Advanced Bookmarks Management System */
/* ==================================================== */
/* */
/* Copyright (c) 2003 by Angel Stoitsov and Mario Stoitsov */
/* http://software.stoitsov.com */
/* */
/* This file is part of EasyBookMarker. */
/* EasyBookMarker is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* EasyBookMarker is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* You should have received a copy of the GNU General Public License */
/* along with EasyBookMarker; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/********************************************************************************/
/*
// Unzip the zip file in some subdirectory (e.g. EasyBookMarker) under the root
// directory on your server. Then follow the three easy steps below
// STEP ONE: Create the tables below under your desired DataBase
// using phpMyAdmin for example
// ********************************************************************
// *********************** Database Tables
// ********************************************************************
/*
DROP TABLE IF EXISTS `ezine_link_bmcategory`;
CREATE TABLE `ezine_link_bmcategory` (
`ID` bigint(20) NOT NULL auto_increment,
`CName` varchar(200) NOT NULL default 'Category Name',
`CDescription` varchar(255) NOT NULL default 'Category Description',
`Parent` bigint(20) default '0',
PRIMARY KEY (`ID`)
) TYPE=MyISAM;
INSERT INTO `ezine_link_bmcategory` (`ID`, `CName`, `CDescription`, `Parent`) VALUES (1, 'Banks', 'USA', 0),
(4, 'Physics', 'All about physics', 0),
(5, 'Conferences', 'Related conferences', 4),
(6, 'Credit Cards', 'USA', 1);
DROP TABLE IF EXISTS `ezine_link_bmlink`;
CREATE TABLE `ezine_link_bmlink` (
`ID` bigint(20) NOT NULL auto_increment,
`LUrl` varchar(255) NOT NULL default '',
`LName` varchar(200) NOT NULL default '',
`LDescription` text NOT NULL,
`Date` date NOT NULL default '0000-00-00',
`Modify` date NOT NULL default '0000-00-00',
`Visit` date NOT NULL default '0000-00-00',
`Hits` bigint(20) NOT NULL default '0',
`Parent` bigint(20) default '0',
PRIMARY KEY (`ID`)
) TYPE=MyISAM;
INSERT INTO `ezine_link_bmlink` (`ID`, `LUrl`, `LName`, `LDescription`, `Date`, `Modify`, `Visit`, `Hits`, `Parent`) VALUES (1, 'https://www48.americanexpress.com/en/en_US/logon/IntlLogLogon.jsp?Face=en_US&DestPage=https%3A%2F%2Fwww48.americanexpress.com%2Fen%2Fcards%3Frequest_type%3Dauthreg_acctAccountSummary%26Face%3Den_US', 'American Express', 'Credit Cards', '2003-02-09', '2003-07-30', '2003-07-30', 1, 6),
(2, 'https://chaseonline.chase.com', 'Chase', 'chase online', '2003-01-23', '2003-07-30', '2003-07-30', 1, 1),
(4, 'https://www.paypal.com/cgi-bin/webscr?cmd=_login-run', 'PayPal', 'ebay', '2003-02-09', '2003-07-30', '2003-07-30', 0, 1),
(6, 'https://www.wilmingtontrust.com', 'Wilmington Trust', 'Wilmington', '2003-01-31', '2003-07-30', '2003-07-30', 0, 1),
(17, 'http://alinea.bg/', 'alinea.bg', 'BG', '2003-01-18', '2003-07-30', '2003-07-30', 0, 0),
(18, 'http://bgfree.biz/', 'bgfree.biz', 'BG', '2003-01-18', '2003-07-30', '2003-07-30', 0, 0),
(21, 'http://mario.stoitsov.com/', 'mario.stoitsov.com', 'BG', '2003-01-18', '2003-07-30', '2003-07-30', 0, 0),
(22, 'http://mp3.bgfree.biz/', 'mp3.bgfree.biz', 'BG', '2003-01-18', '2003-07-30', '2003-07-30', 0, 0),
(25, 'http://stoitsov.com/', 'stoitsov.com', 'BG', '2003-03-05', '2003-07-30', '2003-07-30', 0, 0),
(28, 'http://www.aps.org/', 'American Physical Society', 'for the advancement and diffusion of knowledge of physics', '2003-02-06', '2003-07-30', '2003-07-30', 0, 4),
(29, 'http://ie.lbl.gov/toimass.html', 'Atomic Masses', 'Mass chart', '2003-01-18', '2003-07-30', '2003-07-30', 0, 4),
(35, 'http://www.orau.gov/ria/', 'First RIA Summer School on Exotic Beam Physics', 'ornl', '2003-01-18', '2003-07-30', '2003-07-30', 0, 5),
(45, 'http://alice-france.in2p3.fr/qm2002/', 'Quark matter 2002', 'France', '2003-01-18', '2003-07-30', '2003-07-30', 0, 5),
(47, 'http://www.sciencedirect.com/science?_ob=JournalURL&_cdi=6706&_auth=y&_acct=C000050221&_version=1&_urlVersion=0&_userid=10&md5=5a7cbb5d17d602fee4c60955da87f665', 'ScienceDirect', 'Atomic Data and Nuclear Data Tables', '2003-03-05', '2003-07-30', '2003-07-30', 0, 4),
(48, 'http://xxx.lanl.gov/find/nucl-th', 'Search Physics archives', 'e-prints', '2003-01-22', '2003-07-30', '2003-07-30', 0, 4);
*/
// STEP TWO: Edit your preferences below
// ********************************************************************
// *********************** Config options
// ********************************************************************
$EasyBookmarker["mysql_host"]="localhost"; // change to your MySQL Host
$EasyBookmarker["mysql_user"]="nfo"; // change to your MySQL Username
$EasyBookmarker["mysql_pass"]="safran77"; // change to your MySQL Password
$EasyBookmarker["mysql_base"]="nfo"; // Database name, to contain EasyClassifields tables
$EasyBookmarker["web_user"]="admin"; // Username for WEB - based editing interface
$EasyBookmarker["web_pass"]="adminko"; // Password for WEB - based editing interface
$EasyBookmarker["table_width"]="640"; // Max EasyBookmarker Width default=740px - Expect 800x600 users, rather than 1024x768
$EasyBookmarker["links_per_page"]=20; // How many links to display on Search & Show pages
$EasyBookmarker["DarkColor"]="orange"; // Color of the headings, tables, links
$EasyBookmarker["Background"]="#dddddd"; // Page Background color
$EasyBookmarker["LightColor1"]="#ffffcc"; // Table Highlight type 1
$EasyBookmarker["LightColor2"]="#F5F5F5"; // Table Highlight type 2
// ********************************************************************
// LAST STEP THREE: POINT TO INDEX.PHP and ENJOY !!!
// ********************************************************************
// You do not need to edit below this line
// ********************************************************************
// ********************************************************************
// ********************* Initialization & Constants
// ********************************************************************
$EasyBookmarker["version"]="2.01b";
session_start();
if (!session_is_registered("expanded_folders")) {
$expanded_folders="0"; session_register("expanded_folders");
$Order=1; session_register("Order");
$Chart=1; session_register("Chart");
}
$sql=mysql_connect($EasyBookmarker["mysql_host"],$EasyBookmarker["mysql_user"],$EasyBookmarker["mysql_pass"]) or
Die (bmError("Problem!"," The database server is offline. Try again shortly.","If the problem persists, contact the system administrator."));
mysql_select_db($EasyBookmarker["mysql_base"]) or
Die (bmError("Problem!"," The database is down for maintenance. It takes about 2 minutes to complete.","If the problem persists, contact the system administrator."));
if (isset($follow_link)) {
bmMyQuery("UPDATE ezine_link_bmlink SET Hits=Hits+1, Visit='".date("Y-m-d")."' WHERE ID=$follow_link;");
$Link=bmMyFetch("SELECT LUrl From ezine_link_bmlink WHERE ID=$follow_link;");
Header("Location: ".$Link["LUrl"]);
exit;
}
// ********************************************************************
// ********************** Functions
// ********************************************************************
// include_once "functions.php"; // (Mark 2)
function bmError($Heading="Error!",$Error="",$Solution="") {
return "
$Heading
".mysql_error()."$Error
$Solution
";
} // function Error
function bmTr($width=1,$height=1) {
return "";
}
function bmElement($Element="default",$Arg1="default",$Arg2="default",$Arg3="default",$Arg4="default",$Arg5="default",$Arg6="default") {
switch ($Element) {
case "form" : // Element, Action, Name, Method, Aditional
$Action=$Arg1; $Name=$Arg2; $Method=$Arg3; $Aditional=$Arg4;
if ($Name=="default") $Name="my";
if ($Method=="default") $Method="POST";
if ($Aditional=="default") { $Aditional=""; } else { $Aditional=" ".$Aditional; }
return "";
break;
} // switch
} // function Element
function bmHeading($Heading,$BR=1) {
if ($BR!=0) $ret=" ";
$ret.="".$Heading."";
for ($t=0; $t<$BR; $t++) $ret.=" ";
return $ret."\n";
} // heading
function bmMyQuery($Query) {
Global $sql;
$Res=mysql_query($Query) or Die (bmError("Error!"," Invalid DataBase Query.","
The query is: $Query
If the problem persists, contact the system administrator."));
return $Res;
} // function MyQuery
function bmMyFetch($Query) {
Global $sql;
$Res=mysql_fetch_array(mysql_query($Query)) or Die (bmError("Error!"," Invalid DataBase Query.","
".$Link["LName"]."\n";
} // while links
Export($Folder["ID"],$level, $RH);
For ($t=0; $t<$level[$Folder["ID"]]*2; $t++) $RH.=" ";
$RH.="
\n";
} // while
} // if parent
}
function ShowFolder($Parent=0, &$level, &$ResultHtml, &$Light) {
Global $sql,$Stoitsov,$EasyBookmarker;
$Folders=bmMyQuery("SELECT * FROM ezine_link_bmcategory WHERE Parent=$Parent ORDER BY CName;");
if (mysql_num_rows($Folders)==0 or !isExpandedFolder($Parent)) { // No subFolders or Folder is collapsed
return "";
} else { // There are some subFolders
while ($Folder=mysql_fetch_array($Folders)) {
$Light++;
if (isset($Stoitsov["User"])) {
if ($Light % 2 == 0) { $color="bgcolor=".$EasyBookmarker["Background"].""; } else { $color="bgcolor=".$EasyBookmarker["LightColor1"].""; }
}
$level[$Folder["ID"]]=$level[$Parent]+1;
$ResultHtml.="
";
if (isExpandedFolder($Folder["ID"])) {
$ResultHtml.=ShowLinks($Folder["ID"],$level[$Parent]*10);
}
ShowFolder($Folder["ID"],$level, $ResultHtml, &$Light);
} // while
} // if parent
}
function ShowBrief($What,$HowMany) {
Global $sql, $EasyBookmarker;
$Links=bmMyQuery("SELECT * FROM ezine_link_bmlink ORDER BY $What LIMIT 0,".$HowMany.";");
$ResultHtml="";
while ($Link=mysql_fetch_array($Links)) {
$ResultHtml.=" ".$Link["LName"]." ";
}
return $ResultHtml;
}
function ShowLinks($Parent=0, $distance) {
Global $sql, $Stoitsov,$EasyBookmarker,$OrderQry;
$Links=bmMyQuery("SELECT * FROM ezine_link_bmlink WHERE Parent=$Parent ORDER BY $OrderQry;");
$num_links=mysql_num_rows($Links);
$i=0;
while ($Link=mysql_fetch_array($Links)) {
$i++;
if (isset($Stoitsov["User"])) {
if ($i % 2 != 0) { $color="bgcolor=".$EasyBookmarker["Background"].""; } else { $color="bgcolor=".$EasyBookmarker["LightColor2"]; }
}
$ret.= "
";
} // while
return $ret;
}
// ********************************************************************
// ************************ Actions
// ********************************************************************
if ($action=="login") {
if ($bmUsername==$EasyBookmarker["web_user"] && $bmPassword==$EasyBookmarker["web_pass"]) { // valid user
$Stoitsov["User"]=$EasyBookmarker["web_user"];
session_register("Stoitsov");
} else { // invalid user
$Error="Invalid username or password. ";
$page="login";
}// if
} // Login
if ($action=="remote") {
if ($bmUsername==$EasyBookmarker["web_user"] && $bmPassword==$EasyBookmarker["web_pass"]) { // valid user
$Stoitsov["User"]=$EasyBookmarker["web_user"];
session_register("Stoitsov");
$action="add_link";
$bmLUrl=$url; $bmLName=$name; $bmLDescription="Imported from Quick Add function"; $bmParent="0";
} else { // invalid user
$Error="Invalid username or password. ";
$page="remote";
}// if
} // Remote
if ($action=="add_folder") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to add folders. ";
} else { // valid
unset($Error);
if (strlen(bmHackers($bmCName))<1) $Error="Folder Name is empty. ";
if (strlen(bmHackers($bmCDescription))<1) $Error.="Folder Description is empty. ";
if (isset($Error)) { // There are errors
$page="add_folder";
$parent=$bmParent;
} else { // Add Folder
bmMyQuery("INSERT INTO ezine_link_bmcategory VALUES(null,'".bmHackers($bmCName)."','".bmHackers($bmCDescription)."','$bmParent');");
} // if Errors
} // if valid
} // Add Folder
if ($action=="edit_folder") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to edit folders. ";
} else { // valid
unset($Error);
if (strlen(bmHackers($bmCName))<1) $Error="Folder Name is empty. ";
if (strlen(bmHackers($bmCDescription))<1) $Error.="Folder Description is empty. ";
if (isset($Error)) { // There are errors
$page="edit_folder";
$id=$bmID;
} else { // Edit Folder
bmMyQuery("UPDATE ezine_link_bmcategory SET Parent='".$bmParent."', CName='".bmHackers($bmCName)."', CDescription='".bmHackers($bmCDescription)."' WHERE ID=$bmID;");
} // if Errors
} // if valid
} // Edit Folder
if ($action=="delete_folder") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to delete folders. ";
} else { // valid
bmMyQuery("DELETE FROM ezine_link_bmcategory WHERE ID=$bmID;");
} // if valid
} // Delete Folder
if ($action=="add_link") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to add links. ";
} else { // valid
unset($Error);
if (strlen(bmHackers($bmLUrl))<8) $Error="The link is invalid. ";
if (strlen(bmHackers($bmLName))<1) $Error="Site Name is empty. ";
if (strlen(bmHackers($bmLDescription))<1) $Error.="Site Description is empty. ";
if (isset($Error)) { // There are errors
$page="add_link";
$parent=$bmParent;
} else { // Add Link
bmMyQuery("INSERT INTO ezine_link_bmlink VALUES(null,'".bmHackers($bmLUrl)."','".bmHackers($bmLName)."','".bmHackers($bmLDescription)."','".date("Y-m-d")."','".date("Y-m-d")."','".date("Y-m-d")."',0,'$bmParent');");
} // if Errors
} // if valid
} // Add Link
if ($action=="edit_link") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to edit links. ";
} else { // valid
unset($Error);
if (strlen(bmHackers($bmLUrl))<8) $Error="The link is invalid. ";
if (strlen(bmHackers($bmLName))<1) $Error="Site Name is empty. ";
if (strlen(bmHackers($bmLDescription))<1) $Error.="Site Description is empty. ";
if (isset($Error)) { // There are errors
$page="add_link";
$parent=$bmParent;
$id=$bmID;
} else { // Edit Link
bmMyQuery("UPDATE ezine_link_bmlink SET Parent='".$bmParent."', LUrl='".bmHackers($bmLUrl)."', LName='".bmHackers($bmLName)."', LDescription='".bmHackers($bmLDescription)."', Modify='".date("Y-m-d")."', Visit='".date("Y-m-d")."' WHERE ID=$bmID;");
} // if Errors
} // if valid
} // Edit Link
if ($action=="delete_link") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to delete links. ";
} else { // valid
bmMyQuery("DELETE FROM ezine_link_bmlink WHERE ID=$bmID;");
} // if valid
} // Delete Folder
if ($action=="export") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to export bookmarks. ";
} else { // valid
$RH="\n\nBookmarks\n
Bookmarks
\n";
$RH.="
\n";
Export(0,$level,$RH);
$Links=bmMyQuery("SELECT * FROM ezine_link_bmlink WHERE Parent=0 ORDER BY LName;");
while ($Link=mysql_fetch_array($Links)) {
$RH.="
\n";
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=bookmark.htm");
print $RH;
exit;
} // if
} // export
if ($action=="import") {
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to import bookmarks. ";
} else { // valid
if ($_FILES['file_name']['type']!="text/html") { // invalid format
$page="import";
$Error="You can import only valid HTML/TEXT files. ";
} else { // Valid format, grab
$fd = fopen ($_FILES['file_name']['tmp_name'], "r");
$Level=-1;
$ParentID=Array();
$ParentID[0]=0;
while (!feof ($fd)) {
$buffer = trim(fgets($fd, 4096));
$buffer=str_replace(chr(10),"",$buffer);
$buffer=str_replace(chr(13),"",$buffer);
$buffer=str_replace("
","",$buffer);
$buffer=str_replace("'","`",$buffer);
if ($buffer=="
") $Level++;
if ($buffer=="
") $Level--;
if (strlen($buffer)>9 && $Level>=0) { // Valid tag
// Determine Type of line
if (substr($buffer,1,2)=="H3") { // Its a folder
$bmCName=strip_tags($buffer);
bmMyQuery("INSERT INTO ezine_link_bmcategory Values(null,'".$bmCName."','Imported folder','".$ParentID[$Level]."');");
$ParentID[$Level+1]=mysql_insert_id();
} elseif (substr($buffer,1,6)=="A HREF") { // Its a link
$SplitValues=Array("HREF","ADD_DATE","LAST_VISIT","LAST_MODIFIED","DESCRIPTION","HITS");
$TableValues=Array("bmLUrl","bmDate","bmVisit","bmModify","bmLDescription","bmHits");
for ($t=0; $t
".bmHeading("Spyrosova Linkowňa",0)."
".(isset($Stoitsov["User"]) ? "
" : "" )."
";
$ResultHtml.=ShowLinks(0,0);
$ResultHtml.=$FoldersHtml.
"";
} // End: Main Page
// Start: Chart page
if (isset($page) && $page=="show_links") {
$ResultHtml="";
if (!isset($From)) $From=0;
$TotalLinks=mysql_num_rows(bmMyQuery("SELECT ID FROM ezine_link_bmlink;"));
$Links=bmMyQuery("SELECT * FROM ezine_link_bmlink ORDER BY $ChartQry LIMIT $From,".$EasyBookmarker["links_per_page"].";");
If ($TotalLinks-$From-$EasyBookmarker["links_per_page"]>0) { $More=TRUE; } else { $More=FALSE; }
$ResultHtml=bmHeading("Bookmarks",1)." ".$ChartHeading."
#
Name/Description
Added
Modified
Visited
Clicks
".(isset($Stoitsov["User"]) ? "
Edit
Delete
" : "" )."
";
$i=$From;
while ($Link=mysql_fetch_array($Links)) {
$i++;
if ($i % 2 != 0) { $color="bgcolor=".$EasyBookmarker["Background"].""; } else { $color="bgcolor=".$EasyBookmarker["LightColor2"].""; }
$ResultHtml.="
";
} // End: Chart Page
// Start: Search page
if (isset($page) && $page=="search") {
$ResultHtml="";
$bmSearch=bmHackers($bmSearch);
if (!isset($From)) $From=0;
$TotalLinks=mysql_num_rows(bmMyQuery("SELECT ID FROM ezine_link_bmlink WHERE LName like '%".$bmSearch."%' OR LDescription like '%".$bmSearch."%' OR LUrl like '%".$bmSearch."%';"));
$Links=bmMyQuery("SELECT * FROM ezine_link_bmlink WHERE LName like '%".$bmSearch."%' OR LDescription like '%".$bmSearch."%' OR LUrl like '%".$bmSearch."%' ORDER BY Hits Desc LIMIT $From,".$EasyBookmarker["links_per_page"].";");
If ($TotalLinks-$From-$EasyBookmarker["links_per_page"]>0) { $More=TRUE; } else { $More=FALSE; }
$ResultHtml=bmHeading("Bookmarks",1)." Search for \"".$bmSearch."\"
#
Name/Description
Added
Modified
Visited
Clicks
".(isset($Stoitsov["User"]) ? "
Edit
Delete
" : "" )."
";
$i=$From;
while ($Link=mysql_fetch_array($Links)) {
$i++;
if ($i % 2 != 0) { $color="bgcolor=".$EasyBookmarker["Background"].""; } else { $color="bgcolor=".$EasyBookmarker["LightColor2"].""; }
$ResultHtml.="
";
} // End: Search Page
// Start: Export page
if ($page=="export") {
$ResultHtml="";
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be registered user in order to add categories.";
} else { // valid
$ResultHtml.= bmHeading("Export Bookmarks",2);
$ResultHtml.= "
This function helps you move your bookmarks from EasyBookmarker to your favorite Browser. Once you downloaded the file, follow these instructions:
M$ Internet Explorer
File Menu
Import and Export...
In the wizard, select Import Favorites
Choose Import from file or address option
Select the downloaded file
Netscape 6
Bookmarks Menu
Manage bookmarks
File Menu
Import bookmarks...
Select the downloaded file
Its that simple.
To download your bookmarks, click the link below. If your download does not start, right-click the link and choose Save as option.
";
}
} // End: Export Page
// Start: import page
if ($page=="import") {
$ResultHtml="";
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be registered user in order to add categories.";
} else { // valid
$ResultHtml.= bmHeading("Import Bookmarks",2).
"
This function helps you move your bookmarks from your favorite Browser to the EasyBookmarker.
Tested & works fine with exported bookmarks from:
M$ Internet Explorer 5 and above
Netscape Navigator
Netscape Communicator
Netscape 6
EasyBookmarker 2.0 and above
".$Error."
";
}
} // End: Import Page
// Start: Add Folder page
if (isset($page) && $page=="add_folder" && isset($parent)) {
$ResultHtml="";
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to add categories.";
} else { // valid
if ($parent!=0) {
$UnderCategory=bmMyFetch("SELECT * FROM ezine_link_bmcategory WHERE ID=$parent LIMIT 1");
} else {
$UnderCategory["CName"]="EasyBookmarker";
}
$ResultHtml.=bmHeading("Edit Bookmarks",1).
" New Folder under ".$UnderCategory["CName"]."
";
} // if valid
} // End: Add Folder page
// Start: Edit Folder page
if (isset($page) && $page=="edit_folder" && isset($id)) {
$ResultHtml="";
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be registered user in order to edit the folders.";
} else { // valid
$EditFolder=bmMyFetch("SELECT * FROM ezine_link_bmcategory WHERE ID=$id LIMIT 1");
$isEmpty=mysql_num_rows(bmMyQuery("SELECT * FROM ezine_link_bmlink Where Parent=".$EditFolder["ID"].";"))+
mysql_num_rows(bmMyQuery("SELECT * FROM ezine_link_bmcategory Where Parent=".$EditFolder["ID"].";"));
$CatSelects=bmMyQuery("SELECT * FROM ezine_link_bmcategory Where ID<>$id ORDER BY BINARY CName;");
$Under=$Categories[0]="EasyBookmarker";
while ($CatSelect=mysql_fetch_array($CatSelects)) {
$Categories[$CatSelect["ID"]]=$CatSelect["CName"];
if ($CatSelect["Parent"]==$EditFolder["ID"]) $Under=$CatSelect["CName"];
} // while
$ResultHtml.= bmHeading("Edit Bookmarks",1).
" Edit Folder under ".$Under."
.: Folder Information
".bmElement("form",$PHP_SELF,"Folder","POST")."
Move folder under: [no change - no move]
".bmElement("select","bmParent",$Categories,$EditFolder["Parent"],250)."
";
} // if valid
} // End: Edit Folder page
// Start: Add Link page
if (isset($page) && $page=="add_link" && isset($parent)) {
$ResultHtml="";
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to add links.";
} else { // valid
if ($parent!=0) {
$UnderCategory=bmMyFetch("SELECT * FROM ezine_link_bmcategory WHERE ID=$parent LIMIT 1");
} else {
$UnderCategory["CName"]="EasyBookmarker";
}
$ResultHtml.= bmHeading("Edit Bookmarks",1).
" New Link under ".$UnderCategory["CName"]."
";
} // if valid
} // End: Add Link page
// Start: Edit Link page
if (isset($page) && $page=="edit_link" && isset($id) && isset($parent)) {
$ResultHtml="";
if (!isset($Stoitsov["User"])) { // invalid user
$page="login";
$Error="You need to be a registered user in order to edit the links.";
} else { // valid
if ($parent!=0) {
$UnderCategory=bmMyFetch("SELECT * FROM ezine_link_bmcategory WHERE ID=$parent LIMIT 1");
} else {
$UnderCategory["CName"]="EasyBookmarker";
}
$EditLink=bmMyFetch("SELECT * FROM ezine_link_bmlink WHERE ID=$id LIMIT 1");
$CatSelects=bmMyQuery("SELECT * FROM ezine_link_bmcategory ORDER BY BINARY CName;");
$Categories[0]="EasyBookmarker";
while ($CatSelect=mysql_fetch_array($CatSelects)) {
$Categories[$CatSelect["ID"]]=$CatSelect["CName"];
} // while category
$ResultHtml.= bmHeading("Edit Bookmarks",1).
" Edit Link under ".$UnderCategory["CName"]."
.: Link Information
".bmElement("form",$PHP_SELF,"Link","POST")."
Move Link under: [no change - no move]
".bmElement("select","bmParent",$Categories,$parent,250)."
";
} // if valid
} // End: Edit Link page
// Start: Quick Add
if (isset($page) && $page=="quick_add") {
$ResultHtml="";
$ResultHtml.=bmHeading("Quick Add",1).
" Add your favorite links on the fly.
There is a powerful function in EasyBookmarker called QuickAdd. You may add the page you are currently browsing with your
favorite browser by clicking on a link in it's Favorites (Netscape Bookmarks). To achieve that, you must:
Choose \"File Bookmark for Link...\" from the pop-up menu;
Whenever you deside to add a page to the EasyBookmarker, simply click on \"MyEasyBookmarker - QuickAdd\" located in your Bookmarks menu.
Hope you like it!
";
}
if (isset($page) && $page=="remote") {
$ResultHtml="";
$ResultHtml.=bmHeading("User authorization",1).
" You need to be registered user in order to add bookmarks.
";
}
// End: Quick_Add
// Login page
if (isset($page) && $page=="login") {
$ResultHtml="";
$ResultHtml.=bmHeading("User authorization",1).
" You need to be registered user in order to add, move, edit or delete bookmarks.
";
}
// ********************************************************************
// ********************** HTML Output
// ********************************************************************
// You may edit to suit your site design
// but *please* leave the donation button & author names
// Start HTML HEADER
echo "
spyros.nfo.sk \ odkazy
";
// CSS Style - Edit to fit your site design
echo "
";
// Start HTML BODY
echo "