From fc2d7206bbba283a9367bd7b60315a77b15cf60a Mon Sep 17 00:00:00 2001 From: mikelittle Date: Thu, 22 May 2003 22:51:40 +0000 Subject: [PATCH] More changes for new admin path. Removed relocated files. Moved some more files from b2-include to wp-admin. git-svn-id: http://svn.automattic.com/wordpress/trunk@40 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- b2-include/b2edit.form.php | 150 ------- b2-include/b2edit.showposts.php | 412 ----------------- b2-include/b2footer.php | 23 - b2-include/b2menutop.php | 30 -- b2-include/b2quicktags.php | 33 -- b2-include/b2vars.php | 2 +- b2categories.php | 176 -------- b2config.php | 155 +++---- b2edit.php | 348 --------------- b2header.php | 159 ------- b2install.php | 104 ----- b2login.php | 4 +- b2options.php | 193 -------- b2profile.php | 468 ------------------- b2spell.php | 97 ---- b2team.php | 212 --------- b2template.php | 156 ------- b2upload.php | 250 ----------- linkcategories.php | 207 --------- linkmanager.php | 567 ------------------------ links.all.php | 51 --- links.bookmark.txt | 4 - links.config.php | 83 ---- links.html | 255 ----------- links.install.php | 133 ------ links.php | 330 -------------- links.readme.txt | 190 -------- links.sql | 59 --- links.update-0.5.sql | 34 -- links.update-0.7.sql | 32 -- links.update-1.0.sql | 33 -- links.update-1.3.sql | 33 -- links.weblogs.com.php | 147 ------ {b2-include => wp-admin}/b2.css | 0 wp-admin/b2edit.php | 2 +- wp-admin/b2header.php | 4 +- wp-admin/b2menutop.php | 2 +- {b2-include => wp-admin}/b2menutop.txt | 0 wp-admin/b2profile.php | 4 +- {b2-include => wp-admin}/b2quicktags.js | 0 wp-admin/b2template.php | 2 +- wp-admin/linkcategories.php | 2 - 42 files changed, 89 insertions(+), 5057 deletions(-) delete mode 100644 b2-include/b2edit.form.php delete mode 100644 b2-include/b2edit.showposts.php delete mode 100644 b2-include/b2footer.php delete mode 100644 b2-include/b2menutop.php delete mode 100644 b2-include/b2quicktags.php delete mode 100644 b2categories.php delete mode 100644 b2edit.php delete mode 100644 b2header.php delete mode 100644 b2install.php delete mode 100644 b2options.php delete mode 100644 b2profile.php delete mode 100644 b2spell.php delete mode 100644 b2team.php delete mode 100644 b2template.php delete mode 100644 b2upload.php delete mode 100644 linkcategories.php delete mode 100644 linkmanager.php delete mode 100644 links.all.php delete mode 100644 links.bookmark.txt delete mode 100644 links.config.php delete mode 100644 links.html delete mode 100644 links.install.php delete mode 100644 links.php delete mode 100644 links.readme.txt delete mode 100644 links.sql delete mode 100644 links.update-0.5.sql delete mode 100644 links.update-0.7.sql delete mode 100644 links.update-1.0.sql delete mode 100644 links.update-1.3.sql delete mode 100644 links.weblogs.com.php rename {b2-include => wp-admin}/b2.css (100%) rename {b2-include => wp-admin}/b2menutop.txt (100%) rename {b2-include => wp-admin}/b2quicktags.js (100%) diff --git a/b2-include/b2edit.form.php b/b2-include/b2edit.form.php deleted file mode 100644 index b03ffaa768..0000000000 --- a/b2-include/b2edit.form.php +++ /dev/null @@ -1,150 +0,0 @@ -
'; - } else { - $form_pingback = ''; - } - if ($use_trackback) { - $form_trackback = '


'; - } else { - $form_trackback = ''; - } - $colspan = 3; - break; - case "edit": - $submitbutton_text ="Edit this !"; - $toprow_title = "Editing Post #".$postdata["ID"]; - $form_action = "editpost"; - $form_extra = "\" />\n\n\n - -
- - - - - - - - - - - - - - - - -
- - - -
-
- -
-
-
-
 
-
- " tabindex="1" id="name" />
-
- " tabindex="2" id="email" />
-
- " tabindex="3" id="URL" /> - -
- - - -
-Excerpt :'; -} else { - echo '
'; -} -?> -
 
- -
- - -Post :'; -} else { - echo '
'; -} -?> - - -
- -
- -
- - - - - - - - - - -= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?> - - 4) && ($action != "post")) -if ($user_level > 4) { - touch_time(($action=="edit")); -} -?> - -
- -
diff --git a/b2-include/b2edit.showposts.php b/b2-include/b2edit.showposts.php deleted file mode 100644 index 1e56b9f9a0..0000000000 --- a/b2-include/b2edit.showposts.php +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - - - - - - -
- Show posts: - - - - - - -
-
- 0) { -?> - - - - -
-
-
- - - -
-
-
-
- - -   - -
-
-
-  to   -   - -
-
- - -
- - - - - - - -
-
- - - -
-
-
- - -
-
-
- "; - $arc_sql="SELECT DISTINCT YEAR(post_date), MONTH(post_date) FROM $tableposts ORDER BY post_date DESC"; - $querycount++; - $arc_result=mysql_query($arc_sql) or die($arc_sql."
".mysql_error()); - while($arc_row = mysql_fetch_array($arc_result)) { - $arc_year = $arc_row["YEAR(post_date)"]; - $arc_month = $arc_row["MONTH(post_date)"]; - echo "\n"; - } - } elseif ($archive_mode == "daily") { - echo ""; - if (!isset($start_of_week)) { - $start_of_week = 1; - } - $archive_week_start_date_format = "Y/m/d"; - $archive_week_end_date_format = "Y/m/d"; - $archive_week_separator = " - "; - $arc_sql="SELECT DISTINCT YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date), WEEK(post_date) FROM $tableposts ORDER BY post_date DESC"; - $querycount++; - $arc_result=mysql_query($arc_sql) or die($arc_sql."
".mysql_error()); - $arc_w_last = ''; - while($arc_row = mysql_fetch_array($arc_result)) { - $arc_year = $arc_row["YEAR(post_date)"]; - $arc_w = $arc_row["WEEK(post_date)"]; - if ($arc_w != $arc_w_last) { - $arc_w_last = $arc_w; - $arc_ymd = $arc_year."-".zeroise($arc_row["MONTH(post_date)"],2)."-" .zeroise($arc_row["DAYOFMONTH(post_date)"],2); - $arc_week = get_weekstartend($arc_ymd, $start_of_week); - $arc_week_start = date($archive_week_start_date_format, $arc_week['start']); - $arc_week_end = date($archive_week_end_date_format, $arc_week['end']); - echo "\n"; - } - } - } elseif ($archive_mode == "postbypost") { - echo ''; - echo '"; - ?> - -
-
-
- - - - - - - -
-

- [ - $authordata[13]) or ($user_login == $authordata[1])) { - echo " - Edit"; - echo " - post_title."\'\\n \'Cancel\' to stop, \'OK\' to delete.')\">Delete "; - } - ?> - ] -
- by (), in
- - "; - the_excerpt(); - echo '
'; - if ($safe_mode) - echo ""; - ?> - "; - the_content(); - if ($safe_mode) - echo ""; - ?> -

- - - -

:: comments

- - comment_ID); - ?> - - -

- ( / ) (IP: ) -
- -
- @
- $authordata[13]) or ($user_login == $authordata[1])) { - echo "[ Edit"; - echo " - Delete ]"; - } - ?> -

- - - - Error: please fill the required fields (name & comment)

"; - ?> - -

:: leave a comment

- - - - -
- - " /> -
-
-
-
- Auto-BR (line-breaks become <br> tags)
- - -
- - - - - - -
-
- -
- - - - - - - - - - -
Show posts: - - - - - -
-
-1) { -?> - - - -
-
-
- - - -
-
-
-
- -   -
-
-
-  to    -
-
- \ No newline at end of file diff --git a/b2-include/b2footer.php b/b2-include/b2footer.php deleted file mode 100644 index e4d5db3e42..0000000000 --- a/b2-include/b2footer.php +++ /dev/null @@ -1,23 +0,0 @@ - - -$querycount queries - ".number_format(timer_stop(),3)." seconds"; -} -?> -

 

-
WordPress Support Forums
- - -
- - - - - - - -
- - - \ No newline at end of file diff --git a/b2-include/b2menutop.php b/b2-include/b2menutop.php deleted file mode 100644 index 86cc0ba110..0000000000 --- a/b2-include/b2menutop.php +++ /dev/null @@ -1,30 +0,0 @@ -

WordPress

- - -

diff --git a/b2-include/b2quicktags.php b/b2-include/b2quicktags.php deleted file mode 100644 index 7f1ef714a5..0000000000 --- a/b2-include/b2quicktags.php +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
\ No newline at end of file diff --git a/b2-include/b2vars.php b/b2-include/b2vars.php index 55978cf231..01399c0f3e 100644 --- a/b2-include/b2vars.php +++ b/b2-include/b2vars.php @@ -130,7 +130,7 @@ $b2_htmltranswinuni = array( # these are used for b2's interface design $tabletop = "\t\n\t\n\t
\n\t\t\n\t\t\n\t
\n"; $tablebottom = "\t\t
\n\t
\n"; -$blankline = '
'; +$blankline = '
'; # on which page are we ? $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; diff --git a/b2categories.php b/b2categories.php deleted file mode 100644 index 0b73da77ee..0000000000 --- a/b2categories.php +++ /dev/null @@ -1,176 +0,0 @@ - */ - -function add_magic_quotes($array) { - foreach ($array as $k => $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','standalone','cat'); -for ($i=0; $i$cat_name"); - - header("Location: b2categories.php"); - -break; - -case "Delete": - - $standalone = 1; - require_once("./b2header.php"); - - $cat_ID = $HTTP_POST_VARS["cat_ID"]; - $cat_name=get_catname($cat_ID); - $cat_name=addslashes($cat_name); - - if ($cat_ID=="1") - die("Can't delete the $cat_name category: this is the default one"); - - if ($user_level < 3) - die ("Cheatin' uh ?"); - - $query="DELETE FROM $tablecategories WHERE cat_ID=\"$cat_ID\""; - $result=mysql_query($query) or die("Couldn't delete category $cat_name".mysql_error()); - - $query="UPDATE $tableposts SET post_category='1' WHERE post_category='$cat_ID'"; - $result=mysql_query($query) or die("Couldn't reset category on posts where category was $cat_name"); - - header("Location: b2categories.php"); - -break; - -case "Rename": - - require_once ("./b2header.php"); - $cat_name=get_catname($HTTP_POST_VARS["cat_ID"]); - $cat_name=addslashes($cat_name); - ?> - - -

Old name:

-

-

- New name:
- - " /> -
- -
- - - $cat_name: ".mysql_error()); - - header("Location: b2categories.php"); - -break; - -default: - - $standalone=0; - require_once ("./b2header.php"); - if ($user_level < 3) { - die("You have no right to edit the categories for this blog.
Ask for a promotion to your blog admin :)"); - } - ?> - - - - - - -
-
- Edit a category:
- \n"; - while($row = mysql_fetch_object($result)) { - echo "\t\n"; - } - echo "\n"; - ?>
- - -
-

-

- Add a category:
-

- -
-
- - -
- - - Note:
- Deleting a category does not delete posts from that category.
It will just set them back to the default category . - - - */ -include($b2inc."/b2footer.php"); ?> \ No newline at end of file diff --git a/b2config.php b/b2config.php index 999a30360b..eca3b18e32 100644 --- a/b2config.php +++ b/b2config.php @@ -5,13 +5,13 @@ * */ -# Reminder: everything that starts with #, /* or // is a comment +// Reminder: everything that starts with #, /* or // is a comment /* Start editing */ -# $siteurl is your blog's URL: for example, 'http://mydomain.com' (no trailing slash !) -# $blogfilename is the name of the default file for your blog -# $blogname is the name of your blog +// $siteurl is your blog's URL: for example, 'http://mydomain.com' (no trailing slash !) +// $blogfilename is the name of the default file for your blog +// $blogname is the name of your blog $siteurl = 'http://example.com'; $blogfilename = 'index.php'; @@ -20,38 +20,38 @@ $blogdescription = "babblings !"; -# $pathserver is where you have uploaded b2: for example, 'http://mydomain.com' (no ending slash !) -# by default b2 is set to run in the folder your blog resides, same as $siteurl +// $pathserver is where you have uploaded b2: for example, 'http://mydomain.com' (no ending slash !) +// by default b2 is set to run in the folder your blog resides, same as $siteurl $pathserver = 'http://example.com'; -# your email (obvious eh ?) +// your email (obvious eh ?) $admin_email = 'you@example.com'; -# set this to 0 or 1, whether you want new users to be able to post entries once they registered +// set this to 0 or 1, whether you want new users to be able to post entries once they registered $new_users_can_blog = 0; -# set this to 0 or 1, whether you want to allow users to register on your blog. +// set this to 0 or 1, whether you want to allow users to register on your blog. $users_can_register = 1; -# day at the start of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, etc +// day at the start of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, etc $start_of_week = 1; // ** MySQL settings ** -# fill with your database details +// fill with your database details $dbname = 'b2'; // the name of the database $dbusername = 'user'; // your MySQL username $dbpassword = 'pass'; // ...and password $dbhost = 'localhost'; // 99% chances you won't need to change this value -# database tables' names (change them if you want to have multiple b2's in a single database) +// database tables' names (change them if you want to have multiple b2's in a single database) $tableposts = 'b2posts'; $tableusers = 'b2users'; $tablesettings = 'b2settings'; @@ -61,7 +61,7 @@ $tablecomments = 'b2comments'; // ** Post preview function ** -# set this to 1 if you want to use the 'preview' function +// set this to 1 if you want to use the 'preview' function $use_preview = 1; @@ -69,137 +69,137 @@ $use_preview = 1; // ** Spell Checker functions ** -# set this to 0 to disable the spell checker, or 1 to enable it +// set this to 0 to disable the spell checker, or 1 to enable it $use_spellchecker = 0; // ** Text formatting options ** -# these options can help you format your text without using too much html +// these options can help you format your text without using too much html $use_bbcode = 0; // use BBCode, like [b]bold[/b] $use_gmcode = 0; // use GreyMatter-styles: **bold** \italic\ __underline__ $use_quicktags = 1; // buttons for HTML tags (they won't work on IE Mac yet) -# IMPORTANT! set this to 0 if you are using Chinese, Japanese, Korean, -# or other double-bytes languages +// IMPORTANT! set this to 0 if you are using Chinese, Japanese, Korean, +// or other double-bytes languages $use_htmltrans = 1; -# this could help balance your HTML code. if it gives bad results, set it to 0 +// this could help balance your HTML code. if it gives bad results, set it to 0 $use_balanceTags = 1; // ** Image upload ** -# set this to 0 to disable file upload, or 1 to enable it -$use_fileupload = 0; +// set this to 0 to disable file upload, or 1 to enable it +$use_fileupload = 1; -# enter the real path of the directory where you'll upload the pictures -# if you're unsure about what your real path is, please ask your host's support staff -# note that the directory must be writable by the webserver (ChMod 766) -# note for windows-servers users: use forwardslashes instead of backslashes -#$fileupload_realpath = '/home/your/site/b2/images'; +// enter the real path of the directory where you'll upload the pictures +// if you're unsure about what your real path is, please ask your host's support staff +// note that the directory must be writable by the webserver (ChMod 766) +// note for windows-servers users: use forwardslashes instead of backslashes +//$fileupload_realpath = '/home/your/site/b2/images'; $fileupload_realpath = '/home/example/public_html/images'; -# enter the URL of that directory (it's used to generate the links to the pictures) +// enter the URL of that directory (it's used to generate the links to the pictures) $fileupload_url = 'http://example.com/images'; -# accepted file types, you can add to that list if you want -# note: add a space before and after each file type -# example: $fileupload_allowedtypes = ' jpg gif png '; +// accepted file types, you can add to that list if you want +// note: add a space before and after each file type +// example: $fileupload_allowedtypes = ' jpg gif png '; $fileupload_allowedtypes = ' jpg gif png '; -# by default, most servers limit the size of uploads to 2048 KB -# if you want to set it to a lower value, here it is (you cannot set a higher value) +// by default, most servers limit the size of uploads to 2048 KB +// if you want to set it to a lower value, here it is (you cannot set a higher value) $fileupload_maxk = '96'; -# you may not want all users to upload pictures/files, so you can set a minimum level for this +// you may not want all users to upload pictures/files, so you can set a minimum level for this $fileupload_minlevel = '1'; -# ...or you may authorize only some users. enter their logins here, separated by spaces -# if you leave that variable blank, all users who have the minimum level are authorized to upload -# note: add a space before and after each login name -# example: $fileupload_allowedusers = ' barbara anne '; +// ...or you may authorize only some users. enter their logins here, separated by spaces +// if you leave that variable blank, all users who have the minimum level are authorized to upload +// note: add a space before and after each login name +// example: $fileupload_allowedusers = ' barbara anne '; $fileupload_allowedusers = ''; // ** RSS syndication options ** -# these options are used by b2rdf.php (1.0), b2rss.php (0.92), and b2rss2.php (2.0) -# note: if you don't want to syndicate your news, you can delete these files +// these options are used by b2rdf.php (1.0), b2rss.php (0.92), and b2rss2.php (2.0) +// note: if you don't want to syndicate your news, you can delete these files -# number of last posts to syndicate +// number of last posts to syndicate $posts_per_rss = 10; -# the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 ) +// the language of your blog ( see this: http://backend.userland.com/stories/storyReader$16 ) $rss_language = 'en'; -# for b2rss.php: allow encoded HTML in tag? 1=yes, 0=no +// for b2rss.php: allow encoded HTML in tag? 1=yes, 0=no $rss_encoded_html = 0; -# length (in words) of excerpts in the RSS feed? 0=unlimited -# note: in b2rss.php, this will be set to 0 if you use encoded HTML +// length (in words) of excerpts in the RSS feed? 0=unlimited +// note: in b2rss.php, this will be set to 0 if you use encoded HTML $rss_excerpt_length = 50; -#use the excerpt field for rss feed. +//use the excerpt field for rss feed. $rss_use_excerpt = 1; // ** Weblogs.com ping ** -# set this to 1 if you want your site to be listed on http://weblogs.com when you add a new post +// set this to 1 if you want your site to be listed on http://weblogs.com when you add a new post $use_weblogsping = 0; // ** Blo.gs ping ** -# set this to 1 if you want your site to be listed on http://blo.gs when you add a new post +// set this to 1 if you want your site to be listed on http://blo.gs when you add a new post $use_blodotgsping = 0; -# if you ping blo.gs, this is the URL that will be sent to it (enter your blog's URL): +// if you ping blo.gs, this is the URL that will be sent to it (enter your blog's URL): $blodotgsping_url = 'http://example.com'; // ** Trackback / PingBack ** -# set this to 0 or 1, whether you want to allow your posts to be trackback'able or not -# note: setting it to zero would also disable sending trackbacks +// set this to 0 or 1, whether you want to allow your posts to be trackback'able or not +// note: setting it to zero would also disable sending trackbacks $use_trackback = 1; -# set this to 0 or 1, whether you want to allow your posts to be pingback'able or not -# note: setting it to zero would also disable sending pingbacks +// set this to 0 or 1, whether you want to allow your posts to be pingback'able or not +// note: setting it to zero would also disable sending pingbacks $use_pingback = 1; // ** Comments options ** -# set this to 1 to require e-mail and name, or 0 to allow comments without e-mail/name +// set this to 1 to require e-mail and name, or 0 to allow comments without e-mail/name $require_name_email = 0; -# here is a list of the tags that are allowed in the comments. -# you can add tags to the list, just add them in the string, -# add only the opening tag: for example, only '' instead of '' +// here is a list of the tags that are allowed in the comments. +// you can add tags to the list, just add them in the string, +// add only the opening tag: for example, only '' instead of '' $comment_allowed_tags = '


'; -# set this to 1 to let every author be notified about comments on their posts +// set this to 1 to let every author be notified about comments on their posts $comments_notify = 1; // ** Smilies options ** -# set this to 1 to enable smiley conversion in posts -# (note: this makes smiley conversion in ALL posts) +// set this to 1 to enable smiley conversion in posts +// (note: this makes smiley conversion in ALL posts) $use_smilies = 0; -# the directory where your smilies are (no trailing slash) +// the directory where your smilies are (no trailing slash) $smilies_directory = 'http://example.com/b2-img/smilies'; -# here's the conversion table, you can modify it if you know what you're doing +// here's the conversion table, you can modify it if you know what you're doing $b2smiliestrans = array( ':)' => 'icon_smile.gif', ':D' => 'icon_biggrin.gif', @@ -249,7 +249,7 @@ $b2smiliestrans = array( ); -# the weekdays and the months.. translate them if necessary +// the weekdays and the months.. translate them if necessary $weekday[0]='Sunday'; $weekday[1]='Monday'; @@ -260,7 +260,7 @@ $weekday[5]='Friday'; $weekday[6]='Saturday'; -# the months, translate them if necessary - note: this isn't active everywhere yet +// the months, translate them if necessary - note: this isn't active everywhere yet $month['01']='January'; $month['02']='February'; $month['03']='March'; @@ -276,8 +276,8 @@ $month['12']='December'; -# $b2inc is where the included b2 files are: that's generally the directory b2-include, -# so you shouldn't have to change that setting +// $b2inc is where the included b2 files are: that's generally the directory b2-include, +// so you shouldn't have to change that setting $b2inc = 'b2-include'; @@ -292,31 +292,31 @@ $querystring_separator = '&'; // ** Configuration for b2mail.php ** (skip this if you don't intend to blog via email) -# mailserver settings +// mailserver settings $mailserver_url = 'mail.example.com'; $mailserver_login = 'login@example.com'; $mailserver_pass = 'password'; $mailserver_port = 110; -# by default posts will have this category +// by default posts will have this category $default_category = 1; -# subject prefix +// subject prefix $subjectprefix = 'blog:'; -# body terminator string (starting from this string, everything will be ignored, including this string) +// body terminator string (starting from this string, everything will be ignored, including this string) $bodyterminator = "___"; -# set this to 1 to run in test mode +// set this to 1 to run in test mode $thisisforfunonly = 0; -### Special Configuration for some phone email services +////// Special Configuration for some phone email services -# some mobile phone email services will send identical subject & content on the same line -# if you use such a service, set $use_phoneemail to 1, and indicate a separator string -# when you compose your message, you'll type your subject then the separator string -# then you type your login:password, then the separator, then content +// some mobile phone email services will send identical subject & content on the same line +// if you use such a service, set $use_phoneemail to 1, and indicate a separator string +// when you compose your message, you'll type your subject then the separator string +// then you type your login:password, then the separator, then content $use_phoneemail = 0; $phoneemail_separator = ':::'; @@ -339,6 +339,9 @@ $path = $pathserver; $base = $dbname; // This is so the new admin location works -ini_set('include_path', ".:../:../$b2inc"); +// Set this path separator appropriately for your OS: semi-colon on windows, colon on unix +//$path_sep=';'; +$path_sep=':'; +ini_set('include_path', '.'.$path_sep.'..'.$path_sep."../$b2inc".$path_sep."./$b2inc"); -?> +?> \ No newline at end of file diff --git a/b2edit.php b/b2edit.php deleted file mode 100644 index 4204d2b5fa..0000000000 --- a/b2edit.php +++ /dev/null @@ -1,348 +0,0 @@ - */ - -function add_magic_quotes($array) { - foreach ($array as $k => $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','safe_mode','withcomments','c','posts','poststart','postend','content','edited_post_title','comment_error','profile', 'trackback_url', 'excerpt'); -for ($i=0; $i 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { - $aa = $HTTP_POST_VARS["aa"]; - $mm = $HTTP_POST_VARS["mm"]; - $jj = $HTTP_POST_VARS["jj"]; - $hh = $HTTP_POST_VARS["hh"]; - $mn = $HTTP_POST_VARS["mn"]; - $ss = $HTTP_POST_VARS["ss"]; - $jj = ($jj > 31) ? 31 : $jj; - $hh = ($hh > 23) ? $hh - 24 : $hh; - $mn = ($mn > 59) ? $mn - 60 : $mn; - $ss = ($ss > 59) ? $ss - 60 : $ss; - $now = "$aa-$mm-$jj $hh:$mn:$ss"; - } else { - $now = date("Y-m-d H:i:s",(time() + ($time_difference * 3600))); - } - - $query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt) VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."','".$excerpt."')"; - $result = mysql_query($query) or mysql_oops($query); - - $post_ID = mysql_insert_id(); - - if (isset($sleep_after_edit) && $sleep_after_edit > 0) { - sleep($sleep_after_edit); - } - - rss_update($blog_ID); - pingWeblogs($blog_ID); - pingCafelog($cafelogID, $post_title, $post_ID); - pingBlogs($blog_ID); - if ($post_pingback) { - pingback($content, $post_ID); - } - - if (!empty($HTTP_POST_VARS['trackback_url'])) { - $excerpt = (strlen(strip_tags($content)) > 255) ? substr(strip_tags($content), 0, 252).'...' : strip_tags($content); - $excerpt = stripslashes($excerpt); - $trackback_urls = explode(',', $HTTP_POST_VARS['trackback_url']); - foreach($trackback_urls as $tb_url) { - $tb_url = trim($tb_url); - trackback($tb_url, stripslashes($post_title), $excerpt, $post_ID); - } - } - - if (!empty($HTTP_POST_VARS["mode"])) { - switch($HTTP_POST_VARS["mode"]) { - case "bookmarklet": - $location="b2bookmarklet.php?a=b"; - break; - case "sidebar": - $location="b2sidebar.php?a=b"; - break; - default: - $location="b2edit.php"; - break; - } - } else { - $location="b2edit.php"; - } - header("Location: $location"); - exit(); - -break; - -case "edit": - - $standalone=0; - require_once ("./b2header.php"); - $post = $HTTP_GET_VARS["post"]; - if ($user_level > 0) { - $postdata=get_postdata($post) or die("Oops, no post with this ID. Go back !"); - $authordata = get_userdata($postdata["Author_ID"]); - if ($user_level < $authordata[13]) - die ("You don't have the right to edit ".$authordata[1]."'s posts."); - - $content = $postdata["Content"]; - $content = format_to_edit($content); - $excerpt = $postdata["Excerpt"]; - $excerpt = format_to_edit($excerpt); - $edited_post_title = format_to_edit($postdata["Title"]); - - echo $blankline; - include($b2inc."/b2edit.form.php"); - - } else { - ?> - - Since you're a newcomer, you'll have to wait for an admin to raise your level to 1, in order to be authorized to post.
You can also e-mail the admin to ask for a promotion.
When you're promoted, just reload this page and you'll be able to blog. :) - - 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { - $aa = $HTTP_POST_VARS["aa"]; - $mm = $HTTP_POST_VARS["mm"]; - $jj = $HTTP_POST_VARS["jj"]; - $hh = $HTTP_POST_VARS["hh"]; - $mn = $HTTP_POST_VARS["mn"]; - $ss = $HTTP_POST_VARS["ss"]; - $jj = ($jj > 31) ? 31 : $jj; - $hh = ($hh > 23) ? $hh - 24 : $hh; - $mn = ($mn > 59) ? $mn - 60 : $mn; - $ss = ($ss > 59) ? $ss - 60 : $ss; - $datemodif = ", post_date=\"$aa-$mm-$jj $hh:$mn:$ss\""; - } else { - $datemodif = ""; - } - - $query = "UPDATE $tableposts SET post_content=\"$content\", post_excerpt=\"$excerpt\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID"; - $result = mysql_query($query) or mysql_oops($query); - - if (isset($sleep_after_edit) && $sleep_after_edit > 0) { - sleep($sleep_after_edit); - } - - rss_update($blog_ID); -// pingWeblogs($blog_ID); - - $location = "Location: b2edit.php"; - header ($location); - -break; - -case "delete": - - $standalone = 1; - require_once("./b2header.php"); - - if ($user_level == 0) - die ("Cheatin' uh ?"); - - $post = $HTTP_GET_VARS['post']; - $postdata=get_postdata($post) or die("Oops, no post with this ID. Go back !"); - $authordata = get_userdata($postdata["Author_ID"]); - - if ($user_level < $authordata[13]) - die ("You don't have the right to delete ".$authordata[1]."'s posts."); - - $query = "DELETE FROM $tableposts WHERE ID=$post"; - $result = mysql_query($query) or die("Oops, no post with this ID. Go back !"); - if (!$result) - die("Error in deleting... contact the webmaster..."); - - $query = "DELETE FROM $tablecomments WHERE comment_post_ID=$post"; - $result = mysql_query($query) or die("Oops, no comment associated to that post. Go back !"); - - if (isset($sleep_after_edit) && $sleep_after_edit > 0) { - sleep($sleep_after_edit); - } - - rss_update($blog_ID); -// pingWeblogs($blog_ID); - - header ("Location: b2edit.php"); - -break; - -case "editcomment": - - $standalone=0; - require_once ("./b2header.php"); - - get_currentuserinfo(); - - if ($user_level == 0) { - die ("Cheatin' uh ?"); - } - - $comment = $HTTP_GET_VARS['comment']; - $commentdata = get_commentdata($comment,1) or die("Oops, no comment with this ID. Go back !"); - $content = $commentdata["comment_content"]; - $content = format_to_edit($content); - - echo $blankline; - include($b2inc."/b2edit.form.php"); - -break; - -case "deletecomment": - - $standalone = 1; - require_once("./b2header.php"); - - if ($user_level == 0) - die ("Cheatin' uh ?"); - - $comment = $HTTP_GET_VARS['comment']; - $p = $HTTP_GET_VARS['p']; - $commentdata=get_commentdata($comment) or die("Oops, no comment with this ID. Go back !"); - - $query = "DELETE FROM $tablecomments WHERE comment_ID=$comment"; - $result = mysql_query($query) or die("Oops, no comment with this ID. Go back !"); - - header ("Location: b2edit.php?p=$p&c=1#comments"); //?a=dc"); - -break; - -case "editedcomment": - - $standalone = 1; - require_once("./b2header.php"); - - if ($user_level == 0) - die ("Cheatin' uh ?"); - - $comment_ID = $HTTP_POST_VARS['comment_ID']; - $comment_post_ID = $HTTP_POST_VARS['comment_post_ID']; - $newcomment_author = $HTTP_POST_VARS['newcomment_author']; - $newcomment_author_email = $HTTP_POST_VARS['newcomment_author_email']; - $newcomment_author_url = $HTTP_POST_VARS['newcomment_author_url']; - $newcomment_author = addslashes($newcomment_author); - $newcomment_author_email = addslashes($newcomment_author_email); - $newcomment_author_url = addslashes($newcomment_author_url); - $post_autobr = $HTTP_POST_VARS["post_autobr"]; - - if (($user_level > 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { - $aa = $HTTP_POST_VARS["aa"]; - $mm = $HTTP_POST_VARS["mm"]; - $jj = $HTTP_POST_VARS["jj"]; - $hh = $HTTP_POST_VARS["hh"]; - $mn = $HTTP_POST_VARS["mn"]; - $ss = $HTTP_POST_VARS["ss"]; - $jj = ($jj > 31) ? 31 : $jj; - $hh = ($hh > 23) ? $hh - 24 : $hh; - $mn = ($mn > 59) ? $mn - 60 : $mn; - $ss = ($ss > 59) ? $ss - 60 : $ss; - $datemodif = ", comment_date=\"$aa-$mm-$jj $hh:$mn:$ss\""; - } else { - $datemodif = ""; - } - $content = balanceTags($content); - $content = format_to_post($content); - - $query = "UPDATE $tablecomments SET comment_content=\"$content\", comment_author=\"$newcomment_author\", comment_author_email=\"$newcomment_author_email\", comment_author_url=\"$newcomment_author_url\"".$datemodif." WHERE comment_ID=$comment_ID"; - $result = mysql_query($query) or mysql_oops($query); - - header ("Location: b2edit.php?p=$comment_post_ID&c=1#comments"); //?a=ec"); - -break; - -default: - - $standalone=0; - require_once ("./b2header.php"); - - if ($user_level > 0) { - if ((!$withcomments) && (!$c)) { - - $action="post"; - include($b2inc."/b2edit.form.php"); - echo "

"; - - } - - } else { - - echo $tabletop; ?> - Since you're a newcomer, you'll have to wait for an admin to raise your level to 1, in order to be authorized to post.
You can also e-mail the admin to ask for a promotion.
When you're promoted, just reload this page and you'll be able to blog. :) -
"; - - } - - include($b2inc."/b2edit.showposts.php"); - -} - - -/* */ -include($b2inc."/b2footer.php") ?> \ No newline at end of file diff --git a/b2header.php b/b2header.php deleted file mode 100644 index c6a3cf006b..0000000000 --- a/b2header.php +++ /dev/null @@ -1,159 +0,0 @@ -posts_per_page; - $what_to_show=$row->what_to_show; - $archive_mode=$row->archive_mode; - $time_difference=$row->time_difference; - $autobr=$row->AutoBR; - $date_format=stripslashes($row->date_format); - $time_format=stripslashes($row->time_format); -} - -// let's deactivate quicktags on IE Mac and Lynx, because they don't work there. -if (($is_macIE) || ($is_lynx)) - $use_quicktags=0; - -$b2varstoreset = array('profile','standalone','redirect','redirect_url','a','popuptitle','popupurl','text', 'trackback', 'pingback'); -for ($i=0; $i - - -wordpress > <?php echo $title; ?> - - - - - - - - - - - - - - - - - - -
- -
-
- \ No newline at end of file diff --git a/b2install.php b/b2install.php deleted file mode 100644 index 59803f6eb0..0000000000 --- a/b2install.php +++ /dev/null @@ -1,104 +0,0 @@ - - -b2 > Installation - - - -$msg

"; - echo "

query:
$sql

"; - echo "

error:
$error

"; - die(); -} - -$connexion = mysql_connect($server,$loginsql,$passsql) or die("Can't connect to the database
".mysql_error()); -$dbconnexion = mysql_select_db($base, $connexion); - -if (!$dbconnexion) { - echo mysql_error(); - die(); -} - -echo "Now creating the necessary tables in the database...

"; - - -# Note: if you want to start again with a clean b2 database, -# just remove the // in this file - -// $query = "DROP TABLE IF EXISTS $tableposts"; -// $q = mysql_query($query) or die ("doh, can't drop the table \"$tableposts\" in the database."); - -$query = "CREATE TABLE $tableposts ( ID int(10) unsigned NOT NULL auto_increment, post_author int(4) DEFAULT '0' NOT NULL, post_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, post_content text NOT NULL, post_title text NOT NULL, post_category int(4) DEFAULT '0' NOT NULL, post_karma int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (ID), UNIQUE ID (ID) )"; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tableposts\" in the database.", $query, mysql_error()); - -$now = date('Y-m-d H:i:s'); -$query = "INSERT INTO $tableposts (post_author, post_date, post_content, post_title, post_category) VALUES ('1', '$now', 'This is the first post. Edit or delete it, then start blogging !', 'Hello world !', '1')"; -$q = mysql_query($query) or mysql_doh("doh, can't insert a first post in the table \"$tableposts\" in the database.", $query, mysql_error()); - -echo "posts: OK
"; - -// $query = "DROP TABLE IF EXISTS $tablecategories"; -// $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tablecategories\" in the database."); - -$query="CREATE TABLE $tablecategories (cat_ID int(4) NOT NULL auto_increment, cat_name TINYTEXT not null , KEY (cat_ID))"; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tablecategories\" in the database.", $query, mysql_error()); - -$query = "INSERT INTO $tablecategories (cat_ID, cat_name) VALUES ('0', 'General')"; -$q = mysql_query($query) or mysql_doh("doh, can't set the default category in the table \"$tablecategories\" in the database.", $query, mysql_error()); - -$query = "UPDATE $tableposts SET post_category=\"1\""; -$result = mysql_query($query) or mysql_doh("Oops, can't set the default category on $tableposts.", $query, mysql_error()); - -echo "b2categories: OK
"; - -// $query = "DROP TABLE IF EXISTS $tablecomments"; -// $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tablecomments\" in the database."); - -$query = "CREATE TABLE $tablecomments ( comment_ID int(11) unsigned NOT NULL auto_increment, comment_post_ID int(11) DEFAULT '0' NOT NULL, comment_author tinytext NOT NULL, comment_author_email varchar(100) NOT NULL, comment_author_url varchar(100) NOT NULL, comment_author_IP varchar(100) NOT NULL, comment_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, comment_content text NOT NULL, comment_karma int(11) DEFAULT '0' NOT NULL, PRIMARY KEY (comment_ID) )"; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tablecomments\" in the database.", $query, mysql_error()); - -$now = date('Y-m-d H:i:s'); -$query = "INSERT INTO $tablecomments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content) VALUES ('1', 'miss b2', 'missb2@example.com', 'http://example.com', '127.0.0.1', '$now', 'Hi, this is a comment.
To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.')"; -$q = mysql_query($query) or mysql_doh("doh, can't insert a first comment in the table \"$tablecomments\" in the database.", $query, mysql_error()); - -echo "comments: OK
"; - -// $query = "DROP TABLE IF EXISTS $tablesettings"; -// $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tablesettings\" in the database."); - -$query = "CREATE TABLE $tablesettings ( ID tinyint(3) DEFAULT '1' NOT NULL, posts_per_page int(4) unsigned DEFAULT '7' NOT NULL, what_to_show varchar(5) DEFAULT 'days' NOT NULL, archive_mode varchar(10) DEFAULT 'weekly' NOT NULL, time_difference tinyint(4) DEFAULT '0' NOT NULL, AutoBR tinyint(1) DEFAULT '1' NOT NULL, time_format varchar(20) DEFAULT 'H:i:s' NOT NULL, date_format varchar(20) DEFAULT 'Y/m/d' NOT NULL, PRIMARY KEY (ID), KEY ID (ID) )"; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tablesettings\" in the database.", $query, mysql_error()); - -$query = "INSERT INTO $tablesettings ( ID, posts_per_page, what_to_show, archive_mode, time_difference, AutoBR, time_format, date_format) VALUES ( '1', '20', 'posts', 'monthly', '0', '1', 'H:i:s', 'd.m.y')"; -$q = mysql_query($query) or mysql_doh("doh, can't set the default settings in the table \"$tablesettings\" in the database.", $query, mysql_error()); - -echo "settings: OK
"; - -// $query = "DROP TABLE IF EXISTS $tableusers"; -// $q = mysql_query($query) or mysql_doh("doh, can't drop the table \"$tableusers\" in the database."); - -$query = "CREATE TABLE $tableusers ( ID int(10) unsigned NOT NULL auto_increment, user_login varchar(20) NOT NULL, user_pass varchar(20) NOT NULL, user_firstname varchar(50) NOT NULL, user_lastname varchar(50) NOT NULL, user_nickname varchar(50) NOT NULL, user_icq int(10) unsigned DEFAULT '0' NOT NULL, user_email varchar(100) NOT NULL, user_url varchar(100) NOT NULL, user_ip varchar(15) NOT NULL, user_domain varchar(200) NOT NULL, user_browser varchar(200) NOT NULL, dateYMDhour datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, user_level int(2) unsigned DEFAULT '0' NOT NULL, user_aim varchar(50) NOT NULL, user_msn varchar(100) NOT NULL, user_yim varchar(50) NOT NULL, user_idmode varchar(20) NOT NULL, PRIMARY KEY (ID), UNIQUE ID (ID), UNIQUE (user_login) )"; -$q = mysql_query($query) or mysql_doh("doh, can't create the table \"$tableusers\" in the database.", $query, mysql_error()); - -$random_password = substr(md5(uniqid(microtime())),0,6); - -$query = "INSERT INTO $tableusers (ID, user_login, user_pass, user_firstname, user_lastname, user_nickname, user_icq, user_email, user_url, user_ip, user_domain, user_browser, dateYMDhour, user_level, user_aim, user_msn, user_yim, user_idmode) VALUES ( '1', 'admin', '$random_password', '', '', 'admin', '0', '$admin_email', '', '127.0.0.1', '127.0.0.1', '', '00-00-0000 00:00:01', '10', '', '', '', 'nickname')"; -$q = mysql_query($query) or mysql_doh("doh, can't set the default user in the table \"$tableusers\" in the database.", $query, mysql_error()); - -echo "users: OK
"; - -require_once("wp-links/links.install.php"); -?> - -
-Installation successful !
-
-Now you can log in with the login "admin" and password "".

-
-Note that password carefully ! It is a random password that is given to you when you install b2. If you lose it, you will have to delete the tables from the database yourself, and re-install b2. - - - \ No newline at end of file diff --git a/b2login.php b/b2login.php index 9ed4c29a43..99d6bddc33 100644 --- a/b2login.php +++ b/b2login.php @@ -295,7 +295,7 @@ default: header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); /* different all the time */ header("Cache-Control: no-cache, must-revalidate"); /* to cope with HTTP/1.1 */ header("Pragma: no-cache"); - header("Location: b2edit.php"); + header("Location: wp-admin/b2edit.php"); exit(); } ?> @@ -352,7 +352,7 @@ if ($error) echo "
- + diff --git a/b2options.php b/b2options.php deleted file mode 100644 index 08247ba44e..0000000000 --- a/b2options.php +++ /dev/null @@ -1,193 +0,0 @@ - $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','standalone'); -for ($i=0; $iwebmaster !

".mysql_errno().": ".mysql_error(); - die ($oops); - } - - header ("Location: b2options.php"); - -break; - -default: - - $standalone=0; - include ("./b2header.php"); - if ($user_level <= 3) { - die("You have no right to edit the options for this blog.
Ask for a promotion to your blog admin :)"); - } - ?> - -
- - -
- -
login
- - - - - - - - - - - - - - - - - - - - - - - -
Show:" size="3"> -
Archive mode:
Time difference: - if you're not on the timezone of your server
Date format: - (note)
Time format: - (note)
 
- -
- - - -
-

-About Date & Time formats: -

-

You can format the date & time in many ways, using the PHP syntax.
- As quoted from the PHP manual, here are the letters you can use:
-

-
- The following characters are recognized in the format string:
- a - "am" or "pm"
- A - "AM" or "PM"
- B - Swatch Internet time
- d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"
- D - day of the week, textual, 3 letters; i.e. "Fri"
- F - month, textual, long; i.e. "January"
- g - hour, 12-hour format without leading zeros; i.e. "1" to "12"
- G - hour, 24-hour format without leading zeros; i.e. "0" to "23"
- h - hour, 12-hour format; i.e. "01" to "12"
- H - hour, 24-hour format; i.e. "00" to "23"
- i - minutes; i.e. "00" to "59"
- I (capital i) - "1" if Daylight Savings Time, "0" otherwise.
- j - day of the month without leading zeros; i.e. "1" to "31"
- l (lowercase 'L') - day of the week, textual, long; i.e. "Friday"
- L - boolean for whether it is a leap year; i.e. "0" or "1"
- m - month; i.e. "01" to "12"
- M - month, textual, 3 letters; i.e. "Jan"
- n - month without leading zeros; i.e. "1" to "12"
- r - RFC 822 formatted date; i.e. "Thu, 21 Dec 2000 16:01:07 +0200" (added in PHP 4.0.4)
- s - seconds; i.e. "00" to "59"
- S - English ordinal suffix, textual, 2 characters; i.e. "th", "nd"
- t - number of days in the given month; i.e. "28" to "31"
- T - Timezone setting of this machine; i.e. "MDT"
- U - seconds since the epoch
- w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
- Y - year, 4 digits; i.e. "1999"
- y - year, 2 digits; i.e. "99"
- z - day of the year; i.e. "0" to "365"
- Z - timezone offset in seconds (i.e. "-43200" to "43200"). The offset for timezones west of UTC is always negative, and for those east of UTC is always positive.
-
- Unrecognized characters in the format string will be printed as-is. -
- -

For more information and examples, check the PHP manual on this - page.

-
- \ No newline at end of file diff --git a/b2profile.php b/b2profile.php deleted file mode 100644 index 67f1e94408..0000000000 --- a/b2profile.php +++ /dev/null @@ -1,468 +0,0 @@ - */ - -function add_magic_quotes($array) { - foreach ($array as $k => $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','standalone','redirect','profile','user'); -for ($i=0; $iERROR: please enter your nickname (can be the same as your login)"); - return false; - } - - /* if the ICQ UIN has been entered, check to see if it has only numbers */ - if (!empty($HTTP_POST_VARS["newuser_icq"])) { - if ((ereg("^[0-9]+$",$HTTP_POST_VARS["newuser_icq"]))==false) { - die ("ERROR: your ICQ UIN can only be a number, no letters allowed"); - return false; - } - } - - /* checking e-mail address */ - if (empty($HTTP_POST_VARS["newuser_email"])) { - die ("ERROR: please type your e-mail address"); - return false; - } else if (!is_email($HTTP_POST_VARS["newuser_email"])) { - die ("ERROR: the email address isn't correct"); - return false; - } - - if ($HTTP_POST_VARS["pass1"] == "") { - if ($HTTP_POST_VARS["pass2"] != "") - die ("ERROR: you typed your new password only once. Go back to type it twice."); - $updatepassword = ""; - } else { - if ($HTTP_POST_VARS["pass2"] == "") - die ("ERROR: you typed your new password only once. Go back to type it twice."); - if ($HTTP_POST_VARS["pass1"] != $HTTP_POST_VARS["pass2"]) - die ("ERROR: you typed two different passwords. Go back to correct that."); - $newuser_pass = $HTTP_POST_VARS["pass1"]; - $updatepassword = "user_pass='$newuser_pass', "; - setcookie("cafelogpass",md5($newuser_pass),time()+31536000); - } - - $newuser_firstname=addslashes($HTTP_POST_VARS["newuser_firstname"]); - $newuser_lastname=addslashes($HTTP_POST_VARS["newuser_lastname"]); - $newuser_nickname=addslashes($HTTP_POST_VARS["newuser_nickname"]); - $newuser_icq=addslashes($HTTP_POST_VARS["newuser_icq"]); - $newuser_aim=addslashes($HTTP_POST_VARS["newuser_aim"]); - $newuser_msn=addslashes($HTTP_POST_VARS["newuser_msn"]); - $newuser_yim=addslashes($HTTP_POST_VARS["newuser_yim"]); - $newuser_email=addslashes($HTTP_POST_VARS["newuser_email"]); - $newuser_url=addslashes($HTTP_POST_VARS["newuser_url"]); - $newuser_idmode=addslashes($HTTP_POST_VARS["newuser_idmode"]); - - $query = "UPDATE $tableusers SET user_firstname='$newuser_firstname', ".$updatepassword."user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode' WHERE ID = $user_ID"; - $result = mysql_query($query); - if ($result==false) { - die ("ERROR: couldn't update your profile... please contact the webmaster !

$query

".mysql_error()); - } - - ?> - - - Profile updated !
- If that window doesn't close itself, close it yourself :p - - - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
login
first name
last name
nickname
email
URL
ICQ 0) { echo make_clickable("icq:".$profiledata["user_icq"]); } ?>
AIM
MSN IM
YahooIM
- -
- - - - - - - - - - - - - - -
- ID
- level -
- posts - -
- identity
- -
- -
- -
- - - - - - -
- -

To have a one-click bookmarklet, just copy and paste this
into a new text file:

- -
-

Save it as b2.reg, and double-click on this file in an Explorer
- window. Answer Yes to the question, and restart Internet Explorer.

- That's it, you can now right-click in an IE window and select
- 'Post to b2' to make the bookmarklet appear :)

- -

-

- -
-

-
- - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
login
first name" class="postform" />
last name" class="postform" />
nickname" class="postform" />
email" class="postform" />
URL" class="postform" />
ICQ 0) { echo $profiledata["user_icq"]; } ?>" class="postform" />
AIM" class="postform" />
MSN IM" class="postform" />
YahooIM" class="postform" />
- -
- - - - - - - - - - - - - - - - - - 0) { -?> - - -
- ID
- level -
- posts - -
- identity on the blog:
- -
-
- new password (twice)
-
- -

bookmarklet
add the link to your Favorites/Bookmarks
- -b2 - - -b2 - - - - -

-One-click bookmarklet:
-click here - - -b2 - - -b2 - - -

- -SideBar
-Add the b2 Sidebar ! - -

-SideBar
-Add this link to your favorites:
b2 Sidebar. - -
-


Note: closes the popup window.
- -
- */ -include($b2inc."/b2footer.php") ?> \ No newline at end of file diff --git a/b2spell.php b/b2spell.php deleted file mode 100644 index 59c568a7da..0000000000 --- a/b2spell.php +++ /dev/null @@ -1,97 +0,0 @@ - -Loading Spell Checker - - - -
- -

Loading Spell Checker. Please wait

- - - - - - - - - -

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

- - -
- - diff --git a/b2team.php b/b2team.php deleted file mode 100644 index 1163191091..0000000000 --- a/b2team.php +++ /dev/null @@ -1,212 +0,0 @@ - */ - -$b2varstoreset = array('action','standalone','redirect','profile'); -for ($i=0; $i - - - - - -
Click on an user's login name to see his/her complete Profile.
- To edit your Profile, click on your login name.
- -
- -

Active users - - - - - - - - - 3) { ?> - - - - 0 ORDER BY ID"; - $result = mysql_query($request); - while($row = mysql_fetch_object($result)) { - $user_data = get_userdata2($row->ID); - echo "\n\n"; - $email = $user_data["user_email"]; - $url = $user_data["user_url"]; - $bg1 = ($user_data["user_login"] == $user_login) ? "style=\"background-image: url('b2-img/b2button.gif');\"" : "bgcolor=\"#dddddd\""; - $bg2 = ($user_data["user_login"] == $user_login) ? "style=\"background-image: url('b2-img/b2button.gif');\"" : "bgcolor=\"#eeeeee\""; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - if ($user_level > 3) { - echo "\n"; - } - echo "\n"; - } - - ?> - -
IDNicknameNameE-mailURLLevelLogin
".$user_data["ID"]."".$user_data["user_nickname"]."".$user_data["user_firstname"]." ".$user_data["user_lastname"]." \"e-mail:  "; - if (($user_data["user_url"] != "http://") and ($user_data["user_url"] != "")) - echo "\"website: "; - echo "".$user_data["user_level"]; - if (($user_level >= 2) and ($user_level > ($user_data["user_level"] + 1))) - echo " + "; - if (($user_level >= 2) and ($user_level > $user_data["user_level"]) and ($user_data["user_level"] > 0)) - echo " - "; - echo "".$user_data["user_login"]."
-

- - -
- -

Inactive users (level 0) - - - - - - - - - 3) { ?> - - - - ID); - echo "\n\n"; - $email = $user_data["user_email"]; - $url = $user_data["user_url"]; - $bg1 = ($user_data["user_login"] == $user_login) ? "style=\"background-image: url('b2-img/b2button.gif');\"" : "bgcolor=\"#dddddd\""; - $bg2 = ($user_data["user_login"] == $user_login) ? "style=\"background-image: url('b2-img/b2button.gif');\"" : "bgcolor=\"#eeeeee\""; - echo "\n"; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - if ($user_level > 3) { - echo "\n"; - } - echo "\n"; - } - - ?> - -
IDNicknameNameE-mailURLLevelLogin
".$user_data["ID"]."".$user_data["user_nickname"]."".$user_data["user_firstname"]." ".$user_data["user_lastname"]." \"e-mail:  "; - if (($user_data["user_url"] != "http://") and ($user_data["user_url"] != "")) - echo "\"website: "; - echo "".$user_data["user_level"]; - if ($user_level >= 2) - echo " + "; - if ($user_level >= 3) - echo " X "; - echo "".$user_data["user_login"]."
-

- - - = 3) { ?> -
- - To delete an user, bring his/her level to zero, then click on the red cross.
- Warning: deleting an user also deletes all posts made by this user. - - */ -include($b2inc."/b2footer.php") ?> \ No newline at end of file diff --git a/b2template.php b/b2template.php deleted file mode 100644 index c96afab3a0..0000000000 --- a/b2template.php +++ /dev/null @@ -1,156 +0,0 @@ - */ - -function add_magic_quotes($array) { - foreach ($array as $k => $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','standalone','redirect','profile','error','warning','a','file'); -for ($i=0; $iAsk for a promotion to your blog admin :)"); - } - - $newcontent = stripslashes($HTTP_POST_VARS["newcontent"]); - $file = $HTTP_POST_VARS["file"]; - $f = fopen($file,"w+"); - fwrite($f,$newcontent); - fclose($f); - - header("Location: b2template.php?file=$file&a=te"); - exit(); - -break; - -default: - - include("./b2header.php"); - - if ($user_level <= 3) { - die("You have no right to edit the template for this blog.
Ask for a promotion to your blog admin :)"); - } - - if ($file=="") { - if ($blogfilename != "") { - $file = $blogfilename; - } else { - $file = "b2.php"; - } - } - - if (substr($file,0,2) == "..") - die ("Sorry, can't edit files that are up one directory or more."); - - if (substr($file,1,1) == ":") - die ("Sorry, can't call files with their real path."); - - if (substr($file,0,1) == "/") - $file = ".".$file; - - if (!is_file($file)) - $error = 1; - - $file = stripslashes($file); - - if ((substr($file,0,2) == "b2") and (substr($file,-4,4) == ".php") and ($file != "b2.php")) - $warning = " - this is a b2 file, be careful when editing it !"; - - if (!$error) { - $f = fopen($file,"r"); - $content = fread($f,filesize($file)); -// $content = template_simplify($content); - $content = htmlspecialchars($content); -// $content = str_replace(" - - - -
- $file".$warning; - if ($a == "te") - echo " [ file edited ! ]"; - - if (!$error) { - ?> -
- - - -
- "; - } else { - echo ""; - } - ?> -
- oops, no such file !

"; - } - echo $tablebottom; - ?> -
-
- - You can also edit the comments' template or the popup comments' template, or edit any other file (provided it's writable by the server, e.g. CHMOD 766).
-
- To edit a file, type its name here: -
- - -
-
- Note: of course, you can also edit the files/templates in your text editor and upload them. This online editor is only meant to be used when you don't have access to a text editor... - - - - - */ -include($b2inc."/b2footer.php") ?> \ No newline at end of file diff --git a/b2upload.php b/b2upload.php deleted file mode 100644 index da0d70bf91..0000000000 --- a/b2upload.php +++ /dev/null @@ -1,250 +0,0 @@ - - -b2 > upload images/files - - - - - - - - - - - - - - -
- -

File upload

-

You can upload files of type:

-

The maximum size of the file should be:
KB

-
- - -

- Description:
- -

- -
-
- - - - - - -

Duplicate File?

-

The filename '' already exists!

-

filename '' moved to ''

-

Confirm or rename:

-
- - - - - Alternate name:

-
- Description:
-
- -
-
- - - -

File uploaded !

-

Your file was uploaded successfully !

-

Here's the code to display it:

-

- -
- -
-

-

Image Details:
-name: - -
-size: - KB -
-type: - -

-

-

- -
-

- - - - - - - - \ No newline at end of file diff --git a/linkcategories.php b/linkcategories.php deleted file mode 100644 index 6689f0e548..0000000000 --- a/linkcategories.php +++ /dev/null @@ -1,207 +0,0 @@ -$cat_name
".mysql_error()); - - header("Location: linkcategories.php"); - break; - } // end addcat - case "Delete": - { - $standalone = 1; - require_once("./b2header.php"); - - $cat_id = $HTTP_POST_VARS["cat_id"]; - $cat_name=get_linkcatname($cat_id); - $cat_name=addslashes($cat_name); - - if ($cat_id=="1") - die("Can't delete the $cat_name link category: this is the default one"); - - if ($user_level < $minadminlevel) - die ("Cheatin' uh ?"); - - $query="DELETE FROM $tablelinkcategories WHERE cat_id=\"$cat_id\""; - $result=mysql_query($query) or die("Couldn't delete link category $cat_name".mysql_error()); - - $query="UPDATE $tablelinks SET link_category=1 WHERE link_category='$cat_id'"; - $result=mysql_query($query) or die("Couldn't reset category on links where category was $cat_name"); - - header("Location: linkcategories.php"); - break; - } // end delete - case "Edit": - { - require_once ("./b2header.php"); - $cat_id = $HTTP_POST_VARS["cat_id"]; - $cat_name=get_linkcatname($cat_id); - //$cat_name=addslashes($cat_name); - $auto_toggle=get_autotoggle($cat_id); -?> - - -

Old name:

-

-

- New name:
- - " /> -
- /> auto-toggle?
- -
-

-

Back to manage link categories

- -$cat_name: ".$query.mysql_error()); - - header("Location: linkcategories.php"); - break; - } // end editedcat - default: - { - $standalone=0; - require_once ("./b2header.php"); - if ($user_level < $minadminlevel) { - die("You have no right to edit the link categories for this blog.
Ask for a promotion to your blog admin :)"); - } -?> - - - - - - - - - -
Link Categories:
-
- Edit a link category:
-\n"; - while($row = mysql_fetch_object($result)) { - echo " \n"; - } - echo " \n"; -?> -

- - -
-
- - - Add a link category:
-
- -   auto-toggle?

- -
-
- - - - - - Note:
- Deleting a link category does not delete links from that category.
It will - just set them back to the default category . - - - - - - - diff --git a/linkmanager.php b/linkmanager.php deleted file mode 100644 index e0391a6bd8..0000000000 --- a/linkmanager.php +++ /dev/null @@ -1,567 +0,0 @@ - $v) { - if (is_array($v)) { - $array[$k] = add_magic_quotes($v); - } else { - $array[$k] = addslashes($v); - } - } - return $array; -} - -if (!get_magic_quotes_gpc()) { - $HTTP_GET_VARS = add_magic_quotes($HTTP_GET_VARS); - $HTTP_POST_VARS = add_magic_quotes($HTTP_POST_VARS); - $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); -} - -$b2varstoreset = array('action','standalone','cat_id', 'linkurl', 'name', 'image', - 'description', 'visible', 'target', 'category', 'link_id', - 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel'); -for ($i=0; $iAsk for a promotion to your blog admin :)"); - } - - $sql = "SELECT link_url, link_name, link_image, link_target, link_description, link_visible, link_category AS cat_id, link_rating, link_rel " . - " FROM $tablelinks " . - " WHERE link_id = $link_id"; - - $result = mysql_query($sql) or die("Couldn't execute query.".mysql_error()); - if ($row = mysql_fetch_object($result)) { - $link_url = $row->link_url; - $link_name = stripslashes($row->link_name); - $link_image = $row->link_image; - $link_target = $row->link_target; - $link_category = $row->cat_id; - $link_description = stripslashes($row->link_description); - $link_visible = $row->link_visible; - $link_rating = $row->link_rating; - $link_rel = stripslashes($row->link_rel); - } - -?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Edit a link:
URL:
Display Name/Alt text:
Image:
Description:
Rel:
Rating: -  (Leave at 0 for no rating.) -
Target: value="_blank">_blank  value="_top">_top
Visible: value="Y">Y  value="N">N
Category: -\n"; - while($row = mysql_fetch_object($result)) { - echo " \n"; - } - echo " \n"; -?> -
-   -
- -Ask for a promotion to your blog admin :)"); - } - - switch ($order_by) - { - case 'order_name': $sqlorderby = 'name'; break; - case 'order_url': $sqlorderby = 'url'; break; - case 'order_desc': $sqlorderby = 'description'; break; - case 'order_owner': $sqlorderby = 'owner'; break; - case 'order_rating': $sqlorderby = 'rating'; break; - case 'order_id': //fall through - default: $sqlorderby = 'id'; break; - } - - if ($action != "popup") { -?> - - - - - - - - - - - - - - -
Link Categories:Manage Link Categories
- Show links in category:
-
- Order by: -
-\n"; - echo " \n"; - while($row = mysql_fetch_object($result)) { - echo " \n"; - } - echo " \n"; -?> - - - - -
- - - - - - - - - - - - - - - - - - - - - -link_url); - if (strlen($short_url) > 35) { - $short_url = substr($short_url, 0, 32).'...'; - } - echo("\n"); - echo(" \n"); - echo(" \n"); - if ($row->link_image != null) { - echo(" \n"); - } else { - echo(" \n"); - } - if ($row->link_visible == 'Y') { - echo(" \n"); - } else { - echo(" \n"); - } - echo(" \n"); - echo(" \n"); - echo(" \n"); - echo("\n"); - - echo("\n"); - echo(" \n"); - echo(" \n"); - $my_rel = stripslashes($row->link_rel); - if ($my_rel == '') { - $my_rel = ' '; - } - echo(" \n"); - echo(" \n"); - echo(" \n"); - echo(" \n"); - echo("\n"); - } -?> - -
URLNameImg?Vis?Category  
link_url."\">".$short_url."".stripslashes($row->link_name)."YNYN".stripslashes($row->category)."link_id'; forms['links'].action.value='linkedit'; \" value=\"Edit\" class=\"search\" />link_id'; forms['links'].action.value='Delete'; return confirm('You are about to delete this link.\\n \'Cancel\' to stop, \'OK\' to delete.'); \" value=\"Delete\" class=\"search\" />
Desc: ".stripslashes($row->link_description)."Rel:$my_relRating: ".$row->link_rating."Owner:".$row->user_login."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add a link:
URL:
Display Name/Alt text:
Image:
Description:
Rel:
Rating: -  (Leave at 0 for no rating.) -
Target:_blank _top
Visible:N
Category: -\n"; - while($row = mysql_fetch_object($result)) { - echo " \n"; - } - echo " \n"; -?> -
- -
- - - - - - diff --git a/links.all.php b/links.all.php deleted file mode 100644 index e2ec5425d2..0000000000 --- a/links.all.php +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - <?php bloginfo('name') ?> :: Links - - - - - - - - - - -
- -

-

',' ',true,'name',true,false); ?>

- -
- -

-Close this window'); - } else { - echo('Return home'); - } -?> -

- - - \ No newline at end of file diff --git a/links.bookmark.txt b/links.bookmark.txt deleted file mode 100644 index 33629669e7..0000000000 --- a/links.bookmark.txt +++ /dev/null @@ -1,4 +0,0 @@ -Change the server name in this javascript and add to your browser toolbar. This currently only works in Mozilla. - -javascript:void(linkmanpopup=window.open('http://test.zed1.com/b2/linkmanager.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'Link Manager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus(); - diff --git a/links.config.php b/links.config.php deleted file mode 100644 index e1ab18673e..0000000000 --- a/links.config.php +++ /dev/null @@ -1,83 +0,0 @@ - diff --git a/links.html b/links.html deleted file mode 100644 index 790cfdc829..0000000000 --- a/links.html +++ /dev/null @@ -1,255 +0,0 @@ - - - Links - - - -

Links

- -
-// $Id$
-//
-// Links
-// Copyright (C) 2002 Mike Little -- mike@zed1.com
-//
-// This is an add-on to b2 weblog / news publishing tool
-// b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com
-//
-// **********************************************************************
-// Copyright (C) 2002 Mike Little
-//
-// This program 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.
-//
-// This program 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 this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//
-// Mike Little (mike@zed1.com)
-// *****************************************************************
-
- -

Links is an add-on to b2 weblogging software.

-
    -
  • It plugs in to the admin screens.
  • -
  • It adds to menu commands: Link Categories and Link Manager
  • -
  • It allows you to define multiple categories under which to store your links.
  • -
  • You can then define links with a url, name, optional image, href target and category.
  • -
  • You can then list your links in your template with a simple function call.
  • -
  • You can list them by category id or category name
  • -
  • You can specify text or html to be output before and after each link.
  • -
  • You can specifiy the sort order of the links displayed.
  • -
  • You can add a 'star' rating to your links.
  • -
  • There is special category type, auto-toggle which will allow only on link in the - category to display at once.
  • -
  • Each link is owned by the user who created it. You can only edit or delete links - created by you or someone with a lower b2 administration level than you.
  • -
- - -

You can download it from http://zed1.com/links/links-1.2.zip
- or as a tar ball: http://zed1.com/links/links-1.2.tar.gz

- -

Files:

-
-
links.readme.txt
readme file
-
links.sql
sql to create the necessary database tables
-
links.update-0.5.sql
sql to update the pre 0.5 tables
-
links.update-0.7.sql
sql to update the pre 0.7 tables
-
links.update-1.0.sql
sql to update the pre 1.0 tables
-
linkcategories.php
admin plugin to manage link categories
-
linkmanager.php
admin plugin to manage links
-
links.php
template functions
-
links.install.php
alternate installation method
-
links.config.php
configuration file
-
links.bookmark.txt
mozilla bookmarklet
-
links.all.php
Sample page to show all links
-
links-images\rating-0.gif
ratings image
-
links-images\rating-1.gif
ratings image
-
links-images\rating-2.gif
ratings image
-
links-images\rating-3.gif
ratings image
-
links-images\rating-4.gif
ratings image
-
links-images\rating-5.gif
ratings image
-
links-images\rating-6.gif
ratings image
-
links-images\rating-7.gif
ratings image
-
links-images\rating-8.gif
ratings image
-
links-images\rating-9.gif
ratings image
-
links-images\star.gif
ratings image
-
license.txt
GNU General Public License Version 2
-
- -

Installation:

-
    -
  1. Execute the SQL from the file links.sql. This will create the two tables - and add a default category and an example link. Alternatively, upload - the file links.install.php to your B2 installation directory and load - it into your browser.
  2. -
  3. Edit the b2-include/b2menutop.txt file to add in the two new commands.
    - 5      linkcategories.php       Link Categories
    - 5      linkmanager.php       Link Manager
    - Note: there should be a tab character after the 5 and after the filename.
  4. -
  5. Add the files linkcategories.php, linkmanager.php, links.config.php, and links.php into your b2 install directory.
  6. -
  7. Edit links.config.php to your requirements. There are comments in the file to explain each configuration variable.
  8. -
  9. Login and click on the Link Categories menu command. Here you can edit link categories.
      -
    • Name is the name of the category.
    • -
    • Auto-toggle: if you check this box, this category will only allow one link in this category to be visible at a time. - If you edit an existing link or create a new one with the visible flag set on; all the other links in this category will be - turned off. You can use this feature for a current mood category or current CD.
    • -
    -
  10. -
  11. Click on the Link Manager command to edit links:
      -
    • The url is the href part of the link tag. This is optional; if you wanted to, for example, use it for mood icons.
    • -
    • The name will either be the linked word(s) or the alt and title tag for the image.
    • -
    • The image will be used as the src for an image tag. Use either an absolute address or one relative to your template.
    • -
    • The target is the target of the link. _blank to open in a new browser window, and _top to open in the same window.
    • -
    • The category is the category under which to store this link.
    • -
    • The description is the description to be used as the title tag for the link (if it exists) and the text displayed after the link when no image is defined.
    • -
    • The visibilty flag is used to turn off an individual link. Perhaps when a site goes down temporarily but you don't want to delete your link. See also auto-toggle categories above.
    • -
    • The rating is used to display a number, a number of characters, an image, or a number of images after the link.
    • -
    -
  12. - - -
  13. In your template include_once("links.php")
      -
    • You can then <?php echo get_linkcatname(1); ?> or any category id. - This will output the name of the category (perhaps for a heading)
    • -
    • Then <?php get_links(1); ?> to output all the links in category 1. - You can also specify text to be output before and after the link, and the order - of the links.
    • -
    • You can also <?php get_linksbyname('General'); ?> To output all the links in the category called General.
    • -
    • Other functions are get_linksbyname_withrating(), get_links_withrating(), and get_linkcatname().
    • -
    • See the comments above each function for full details. -
    -
  14. - -
  15. Bookmarklet: I have a partially working bookmarklet to add to your browser toolbar.
      -
    • Clicking on this while viewing a site will cause the 'add a link' form to - pop up in a new window with the site url and title pre-filled.
    • -
    • This currently *only* works if you are already logged in to b2. The - bookmarklet *only* works in Mozilla.
    • - -
- -

Updating:

-
    -
  1. If you are updating from a pre 0.5 version, you will need to execute the sql in links.update-0.5.sql
  2. -
  3. If you are updating from a pre 0.7 version, you will need to execute the sql in links.update-0.7.sql
  4. -
  5. If you are updating from a pre 1.0 version, you will need to execute the sql in links.update-1.0.sql
  6. -
- -
- -

Changes

-
    -
  • 1.2 - Name change and minor bug fixes.
  • -
  • 1.1 - Added sample 'list all links' file. - Added links_popup_script() function. - Added the ability to return links in random order. - Bug fixes: Can't create new category without auto-toggle. - links.install.php does not compile with smartquotes turned on. - Added missing title to linkcategories.php
  • -
  • 1.0 - Added mysql_connect() call to install script. - Added separate configuration file. - Added cookie to remember 'show' filter when managing links. - Add ratings system. - Added auto-toggle category flag. - Added descending to sort order.
  • -
  • 0.9.1 - Added links.install.php DB installation script
  • -
  • 0.9 - URLs are optional. Delete asks for confirmation. You can now turn - off the descriptions, even if you have no image or images turned off.
  • -
  • 0.8 - Added orderby parameter to output functions. - In the link manager you can now sort your list of links. - User level visibility now controlled by a variable at the top of - linkmanager.php
  • -
  • 0.7 - Added link owners. Added truncation of long urls.
  • -
  • 0.6 - Added ability to not show images. Partially functional - 'add link' bookmarklet. Documented template functions.
  • -
  • 0.5 - Added description and visibility flag.
  • -
  • 0.4 - Add stripslashes() calls in a couple of places.
  • -
  • 0.3 - fixed bad mysql call
  • -
  • 0.2 - fixed bad sql script
  • -
  • 0.1 - initial release
  • -
- -
- - -

Screen shots

-
    -
  • When you've added the lines to b2menutop.txt your menu should look like this:
    -picture of admin menu
  • - -
  • Clicking on the 'Link Categories' menu will give you a page like this:
    -picture of editing link categories
  • - -
  • Editing an existing category looks like this:
    -picture of editing a link
  • - -
  • Clicking on the 'Link Manager' menu will give you a page like this:
    -picture of managing links
  • -
  • You can choose display all your links or just a single category of links. You can also select the sort order.
  • - -
  • Adding a new link is at the bottom of the link manager page:
    -picture of editing a link
  • - -
  • Editing an individual link looks like this:
    -picture of editing a link
  • - -
  • In your template you can output the link categories as seperate lists like this:
    -You can see the description as title attribute for both text links and image -links. You can also see the description output after the text links.
    -picture of link output picture of link outputpicture of link output
  • -
- -
-

Thats about it really. This is reasonably stable software, however is has not been extensively tested. Use with caution.

- -
-

Buttons

-

I've now created some 'Powered by Links' buttons for those of you who wish to show your support.

-

All you need to do is choose one of the images below, upload it to your own server, and create a link with the following HTML: -

-
-
-              <a href="http://zed1.com/links/" title="Links">
-              <img src="/path/to/the/image.png" alt="Links" border="0" /></a>
-
-
- - - - - - - - - - - - - - - - - -
Powered by LinksPowered by Links
Rendered
on a black background
Transparent (Rendered
on a black background)
Powered by LinksPowered by Links
Rendered
on a white background
Transparent (rendered
on a white background)
- -
-

--
-Mike Little
-mike@zed1.com

- - - - - - - diff --git a/links.install.php b/links.install.php deleted file mode 100644 index 9c6c224859..0000000000 --- a/links.install.php +++ /dev/null @@ -1,133 +0,0 @@ -".mysql_error()); -$dbconnexion = mysql_select_db($base, $connexion); - -$got_links = false; -$got_cats = false; -$got_row = false; -?> - -links > Installation - - -

Checking for tables...

-\n"; -} -if (!$got_cats) { - echo "

Can't find table '$tablelinkcategories', gonna create it...

\n"; - $sql = "CREATE TABLE $tablelinkcategories ( " . - " cat_id int(11) NOT NULL auto_increment, " . - " cat_name tinytext NOT NULL, ". - " auto_toggle enum ('Y','N') NOT NULL default 'N', ". - " PRIMARY KEY (cat_id) ". - ") "; - $result = mysql_query($sql) or print ("Can't create the table '$tablelinkcategories' in the database.
" . $sql . "
" . mysql_error()); - if ($result != false) { - echo "

Table '$tablelinkcategories' created OK

\n"; - $got_cats = true; - } -} else { - echo "

Found table '$tablelinkcategories', don't need to create it...

\n"; - $got_cats = true; -} -if (!$got_links) { - echo "

Can't find '$tablelinks', gonna create it...

\n"; - $sql = "CREATE TABLE $tablelinks ( " . - " link_id int(11) NOT NULL auto_increment, " . - " link_url varchar(255) NOT NULL default '', " . - " link_name varchar(255) NOT NULL default '', " . - " link_image varchar(255) NOT NULL default '', " . - " link_target varchar(25) NOT NULL default '', " . - " link_category int(11) NOT NULL default 0, " . - " link_description varchar(255) NOT NULL default '', " . - " link_visible enum ('Y','N') NOT NULL default 'Y', " . - " link_owner int NOT NULL DEFAULT '1', " . - " link_rating int NOT NULL DEFAULT '0', " . - " link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " . - " link_rel varchar(255) NOT NULL default '', " . - " PRIMARY KEY (link_id) " . - ") "; - $result = mysql_query($sql) or print ("Can't create the table '$tablelinks' in the database.
" . $sql . "
" . mysql_error()); - if ($result != false) { - echo "

Table '$tablelinks' created OK

\n"; - $got_links = true; - } -} else { - echo "

Found table '$tablelinks', don't need to create it...

\n"; - $got_links = true; -} - -if ($got_links && $got_cats) { - echo "

Looking for category 1...

\n"; - $sql = "SELECT * FROM $tablelinkcategories WHERE cat_id=1 "; - $result = mysql_query($sql) or print ("Can't query '$tablelinkcategories'.
" . $sql . "
" . mysql_error()); - if ($result != false) { - if ($row = mysql_fetch_object($result)) { - echo "

You have at least got category 1. Good!

\n"; - $got_row = true; - } else { - echo "

Gonna insert category 1...

\n"; - $sql = "INSERT INTO $tablelinkcategories (cat_id, cat_name) VALUES (1, 'General')"; - $result = mysql_query($sql) or print ("Can't query insert category.
" . $sql . "
" . mysql_error()); - if ($result != false) { - echo "

Inserted category Ok

\n"; - $got_row = true; - } - } - } -} - -if ($got_row) { - echo "

All done.

\n"; -} -?> - - diff --git a/links.php b/links.php deleted file mode 100644 index b231e7315e..0000000000 --- a/links.php +++ /dev/null @@ -1,330 +0,0 @@ -') - the html to output after the link - ** between (default ' ') - the html to output between the link/image - ** and it's description. Not used if no image or show_images == true - ** show_images (default true) - whether to show images (if defined). - ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', - ** 'url', 'description' or 'rating'. Or maybe owner. If you start the - ** name with an underscore the order will be reversed. - ** You can also specify 'rand' as the order which will return links in a - ** random order. - ** show_description (default true) - whether to show the description if - ** show_images=false/not defined - ** show_rating (default false) - show rating stars/chars - ** limit (default -1) - Limit to X entries. If not specified, all entries - ** are shown. - ** show_updated (default 0) - whether to show last updated timestamp - */ -function get_linksbyname($cat_name = "noname", $before = '', $after = '
', - $between = " ", $show_images = true, $orderby = 'id', - $show_description = true, $show_rating = false, - $limit = -1, $show_updated = 0) { - global $tablelinkcategories; - $cat_id = -1; - $sql = "SELECT cat_id FROM $tablelinkcategories WHERE cat_name='$cat_name'"; - $result = mysql_query($sql) - or die("Oops, couldn't query the db for categories." - . $sql . mysql_error()); - if ($row = mysql_fetch_object($result)) { - $cat_id = $row->cat_id; - } - get_links($cat_id, $before, $after, $between, $show_images, $orderby, - $show_description, $show_rating, $limit, $show_updated); -} - - -/** function get_links() - ** Gets the links associated with category n. - ** Parameters: - ** category (default -1) - The category to use. If no category supplied - ** uses all - ** before (default '') - the html to output before the link - ** after (default '
') - the html to output after the link - ** between (default ' ') - the html to output between the link/image - ** and it's description. Not used if no image or show_images == true - ** show_images (default true) - whether to show images (if defined). - ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', - ** 'url', 'description', or 'rating'. Or maybe owner. If you start the - ** name with an underscore the order will be reversed. - ** You can also specify 'rand' as the order which will return links in a - ** random order. - ** show_description (default true) - whether to show the description if - ** show_images=false/not defined . - ** show_rating (default false) - show rating stars/chars - ** limit (default -1) - Limit to X entries. If not specified, all entries - ** are shown. - ** show_updated (default 0) - whether to show last updated timestamp - */ -function get_links($category = -1, $before = '', $after = '
', - $between = " ", $show_images = true, $orderby = 'id', - $show_description = true, $show_rating = false, - $limit = -1, $show_updated = 0) { - - global $tablelinks, $links_rating_type, $links_rating_char, - $links_rating_image, $links_rating_ignore_zero, - $links_rating_single_image; - - $direction = ' ASC'; - $category_query = ""; - if ($category != -1) { - $category_query = " AND link_category = $category "; - } - if ($show_updated) { - $get_updated = ", DATE_FORMAT(link_updated, '%d/%m/%Y %h:%i') AS link_updated "; - } - dbconnect(); - $sql = "SELECT link_url, link_name, link_image, link_target, " . - " link_description, link_rating, link_rel $get_updated " . - " FROM $tablelinks " . - " WHERE link_visible = 'Y' " . - $category_query; - if ($orderby == '') - $orderby = 'id'; - if (substr($orderby,0,1) == '_') { - $direction = ' DESC'; - $orderby = substr($orderby,1); - } - if (strcasecmp('rand',$orderby) == 0) { - $orderby = 'rand()'; - } else { - $orderby = " link_" . $orderby; - } - $sql .= ' ORDER BY ' . $orderby; - $sql .= $direction; - /* The next 2 lines implement LIMIT TO processing */ - if ($limit != -1) - $sql .= " LIMIT $limit"; - - $result = mysql_query($sql) - or die("Couldn't execute query. " . $sql . mysql_error()); - while ($row = mysql_fetch_object($result)) { - echo($before); - $the_link = '#'; - if (($row->link_url != null) || ($row->link_url != '')) { - $the_link = $row->link_url; - } - $rel = stripslashes($row->link_rel); - if ($rel != '') { - $rel = 'rel="'.$rel.'"'; - } - echo("link_description) . - "\" target=\"$row->link_target\">"); - if (($row->link_image != null) && $show_images) { - echo("link_image\" border=\"0\" alt=\"" . - stripslashes($row->link_name) . "\" title=\"" . - stripslashes($row->link_description) . "\" />"); - } else { - echo(stripslashes($row->link_name)); - } - if ((($row->link_image != null) && $show_images) || !$show_description) { - echo(""); - } else { - echo("$between" . stripslashes($row->link_description)); - } - - if ($show_updated) { - if (substr($row->link_updated,0,2) != '00') { - echo("$between " . $row->link_updated); - } - } - // now do the rating - if ($show_rating) { - echo($between); - if ($links_rating_type == 'number') { - if (($row->link_rating != 0) || ($links_rating_ignore_zero != 1)) { - echo(" $row->link_rating\n"); - } - } else if ($links_rating_type == 'char') { - for ($r = $row->link_rating; $r > 0; $r--) { - echo($links_rating_char); - } - } else if ($links_rating_type == 'image') { - if ($links_rating_single_image) { - for ($r = $row->link_rating; $r > 0; $r--) { - echo(' ' .
-                             $row->link_rating.''."\n"); - } - } else { - if (($row->link_rating != 0) || ($links_rating_ignore_zero != 1)) { - echo(' ' .
-                             $row->link_rating.''."\n"); - } - } - } // end if image - } // end if show_rating - echo("$after\n"); - } // end while -} - -/** function get_linksbyname_withrating() - ** Gets the links associated with category 'cat_name' and display rating stars/chars. - ** Parameters: - ** cat_name (default 'noname') - The category name to use. If no - ** match is found uses all - ** before (default '') - the html to output before the link - ** after (default '
') - the html to output after the link - ** between (default ' ') - the html to output between the link/image - ** and it's description. Not used if no image or show_images == true - ** show_images (default true) - whether to show images (if defined). - ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', - ** 'url' or 'description'. Or maybe owner. If you start the - ** name with an underscore the order will be reversed. - ** You can also specify 'rand' as the order which will return links in a - ** random order. - ** show_description (default true) - whether to show the description if - ** show_images=false/not defined - ** limit (default -1) - Limit to X entries. If not specified, all entries - ** are shown. - ** show_updated (default 0) - whether to show last updated timestamp - */ -function get_linksbyname_withrating($cat_name = "noname", $before = '', - $after = '
', $between = " ", - $show_images = true, $orderby = 'id', - $show_description = true, $limit = -1, $show_updated = 0) { - - get_linksbyname($cat_name, $before, $after, $between, $show_images, - $orderby, $show_description, true, $limit, $show_updated); -} - -/** function get_links_withrating() - ** Gets the links associated with category n and display rating stars/chars. - ** Parameters: - ** category (default -1) - The category to use. If no category supplied - ** uses all - ** before (default '') - the html to output before the link - ** after (default '
') - the html to output after the link - ** between (default ' ') - the html to output between the link/image - ** and it's description. Not used if no image or show_images == true - ** show_images (default true) - whether to show images (if defined). - ** orderby (default 'id') - the order to output the links. E.g. 'id', 'name', - ** 'url' or 'description'. Or maybe owner. If you start the - ** name with an underscore the order will be reversed. - ** You can also specify 'rand' as the order which will return links in a - ** random order. - ** show_description (default true) - whether to show the description if - ** show_images=false/not defined . - ** limit (default -1) - Limit to X entries. If not specified, all entries - ** are shown. - ** show_updated (default 0) - whether to show last updated timestamp - */ -function get_links_withrating($category = -1, $before = '', $after = '
', - $between = " ", $show_images = true, - $orderby = 'id', $show_description = true, - $limit = -1, $show_updated = 0) { - - get_links($category, $before, $after, $between, $show_images, $orderby, - $show_description, true, $limit, $show_updated); -} - -/** function get_linkcatname() - ** Gets the name of category n. - ** Parameters: id (default 0) - The category to get. If no category supplied - ** uses 0 - */ -function get_linkcatname($id = 0) { - global $tablelinkcategories; - $cat_name = "noname"; - $sql = "SELECT cat_name FROM $tablelinkcategories WHERE cat_id=$id"; - $result = mysql_query($sql) - or die("Couldn't query the db for categories:". $sql. mysql_error()); - if ($row = mysql_fetch_object($result)) { - $cat_name = stripslashes($row->cat_name); - } - return $cat_name; -} - -/** function get_get_autotoggle() - ** Gets the auto_toggle setting of category n. - ** Parameters: id (default 0) - The category to get. If no category supplied - ** uses 0 - */ -function get_autotoggle($id = 0) { - global $tablelinkcategories; - $auto_toggle = "N"; - $sql = "SELECT auto_toggle FROM $tablelinkcategories WHERE cat_id=$id"; - $result = mysql_query($sql) - or die("Couldn't query the db for categories:". $sql. - mysql_error()); - if ($row = mysql_fetch_object($result)) { - $auto_toggle = $row->auto_toggle; - } - return $auto_toggle; -} - -/** function links_popup_script() - ** This function contributed by Fullo -- http://sprite.csr.unibo.it/fullo/ - ** Show the link to the links popup and the number of links - ** Parameters: - ** text (default Links) - the text of the link - ** width (default 400) - the width of the popup window - ** height (default 400) - the height of the popup window - ** file (default linkspopup.php) - the page to open in the popup window - ** count (default true) - the number of links in the db - */ -function links_popup_script($text = 'Links', $width=400, $height=400, - $file='links.all.php', $count = true) { - global $tablelinks; - if ($count == true) { - $sql = "SELECT count(*) FROM $tablelinks"; - $result = mysql_query($sql) - or die("Couldn't query the db for categories:". $sql . - mysql_error()); - - if ($row = mysql_fetch_row($result)) { - $counts = $row[0]; - } - } - - $javascript = ""; - $javascript .= $text; - - if ($count == true) { - $javascript .= " ($counts)"; - } - - $javascript .="\n\n"; - echo $javascript; -} - -?> diff --git a/links.readme.txt b/links.readme.txt deleted file mode 100644 index 8b7ac5bf75..0000000000 --- a/links.readme.txt +++ /dev/null @@ -1,190 +0,0 @@ -// $Id$ -// -// Links -// Copyright (C) 2002 Mike Little -- mike@zed1.com -// -// This is an add-on to b2 weblog / news publishing tool -// b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com -// -// ********************************************************************** -// Copyright (C) 2002 Mike Little -// -// This program 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. -// -// This program 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 this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// -// Mike Little (mike@zed1.com) -// ***************************************************************** - -Links is an add-on to b2 weblogging software. - * It plugs in to the admin screens. - * It adds to menu commands: Link Categories and Link Manager - * It allows you to define multiple categories under which to store your links. - * You can then define links with a url, name, optional image, href - target and category. - * You can then list your links in your template with a simple function call. - * You can list them by category id or category name - * You can specify text or html to be output before and after each link. - * You can specifiy the sort order of the links displayed. - * You can add a 'star' rating to your links. - * There is special category type, auto-toggle which will allow only on link in - the category to display at once. - * Each link is owned by the user who created it. You can only edit or delete - links created by you or someone with a lower b2 administration level than you. - - -Files: -links.readme.txt - this file -links.sql - sql to create the necessary database tables -links.update-0.5.sql - sql to update the pre 0.5 tables -links.update-0.7.sql - sql to update the pre 0.7 tables -links.update-1.0.sql - sql to update the pre 1.0 tables -linkcategories.php - admin plugin to manage link categories -linkmanager.php - admin plugin to manage links -links.php - template functions -links.install.php - alternate installation method -links.config.php - configuration file -links.bookmark.txt - mozilla bookmarklet -links.all.php - Sample page to show all links -links-images\rating-0.gif - ratings images -links-images\rating-1.gif -links-images\rating-2.gif -links-images\rating-3.gif -links-images\rating-4.gif -links-images\rating-5.gif -links-images\rating-6.gif -links-images\rating-7.gif -links-images\rating-8.gif -links-images\rating-9.gif -links-images\star.gif -license.txt - GNU General Public License Version 2 - -You can download it from http://zed1.com/links/links-1.1.zip or http://zed1.com/links/links-1.1.tar.gz - -There is an html version of this readme file at -http://zed1.com/links/links.html with screenshots and more detailed info. - -Installation: - -1. Execute the SQL from the file links.sql. This will create the two - tables and add a default category and an example link. Alternatively, upload - the file links.install.php to your B2 installation directory and - load it into your browser. - -2. Edit the b2-include/b2menutop.txt file to add in the two new commands. - -5 linkcategories.php Link Categories -5 linkmanager.php Link Manager - - Note: there should be a tab character after the 5 and after the filename. - -3. Add the files linkcategories.php, linkmanager.php, links.config.php, - and links.php into your b2 install directory. - -4. Edit links.config.php to your requirements. There are comments in the file - to explain each configuration variable. - -5. Login and click on the Link Categories menu command. Here you can - create or edit link categories. - - Name is the name of the category. - - Auto-toggle: if you check this box, this category will only allow one link - in this category to be visible at a time. If you edit an existing link or - create a new one with the visible flag set on; all the other links in this - category will be turned off. You can use this feature for a current mood - category or current CD. - -6. Click on the Link Manager command to edit links: - - The url is the href part of the link tag. This is optional; if you wanted - to, for example, use it for mood icons. - - The name will either be the linked word(s) or the alt and title tag for - the image. - - Image will be used as the src for an image tag. Use either an absolute - address or one relative to your template. - - Target is the target of the link. _blank to open in a new browser window, - and _top to open in the same window. - - Category is the category under which to store this link. - - Description is the description to be used as the title tag for the link - (if it exists) and the text displayed after the link when no image is - defined. - - Visible flag is used to turn off an individual link. Perhaps when a site - goes down temporarily but you don't want to delete your link. See also - auto-toggle categories above. - - Rating is used to display a number, a number of characters, an image, or a - number of images after the link. - -7. In your template include_once("links.php") - - You can then or any category id. This will - output the name of the category (perhaps for a heading) - - Then to output all the links in category 1. You can - also specify text to be output before and after the link, and the order of - the links. - - You can also to output all the links in - the category called General. - - Other functions are get_linksbyname_withrating(), get_links_withrating(), - and get_linkcatname(). - - See the comments above each function for full details. - -9. Bookmarklet: I have a partially working bookmarklet to add to your browser - toolbar. - - Clicking on this while viewing a site will cause the 'add a link' form to - pop up in a new window with the site url and title pre-filled. - - This currently *only* works if you are already logged in to b2. The - bookmarklet *only* works in Mozilla. - -Updating: - -1. If you are updating from a pre 0.5 version, you will need to execute the sql - in links.update-0.5.sql -2. If you are updating from a pre 0.7 version, you will need to execute the sql - in links.update-0.7.sql -3. If you are updating from a pre 1.0 version, you will need to execute the sql - in links.update-1.0.sql - -Changes: - - 1.1 - Added sample 'list all links' file. - Added links_popup_script() function. - Added the ability to return links in random order. - Bug fixes: Can't create new category without auto-toggle. - links.install.php does not compile with smartquotes turned on. - Added missing title to linkcategories.php - 1.0 - Added mysql_connect() call to install script. - Added separate configuration file. - Added cookie to remember 'show' filter when managing links. - Add ratings system. - Added auto-toggle category flag. - Added descending to sort order. - 0.9.1 - Added links.install.php DB installation script - 0.9 - URLs are optional. Delete asks for confirmation. You can now turn - off the descriptions, even if you have no image or images turned off. - 0.8 - Added orderby parameter to output functions. - In the link manager you can now sort your list of links. - User level visibility now controlled by a variable at the top of - linkmanager.php - 0.7 - Added link owners. Added truncation of long urls. - 0.6 - Added ability to not show images. Partially functional - 'add link' bookmarklet. Documented template functions. - 0.5 - Added description and visibility flag. - 0.4 - Add stripslashes() calls in a couple of places. - 0.3 - fixed bad mysql call - 0.2 - fixed bad sql script - 0.1 - initial release - - -Thats about it really. This is reasonably stable software, however is has not -been extensively tested. Use with caution. - - --- -Mike Little -mike@zed1.com diff --git a/links.sql b/links.sql deleted file mode 100644 index a6d0e396d8..0000000000 --- a/links.sql +++ /dev/null @@ -1,59 +0,0 @@ --- -------------------------------------------------------- --- // $Id$ --- // --- // Links --- // Copyright (C) 2002 Mike Little -- mike@zed1.com --- // --- // This is an add-on to b2 weblog / news publishing tool --- // b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com --- // --- // ********************************************************************** --- // Copyright (C) 2002 Mike Little --- // --- // This program 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. --- // --- // This program 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 this program; if not, write to the Free Software --- // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --- // --- // Mike Little (mike@zed1.com) --- // ***************************************************************** - --- DROP TABLE IF EXISTS b2links; -CREATE TABLE b2links ( - link_id int(11) NOT NULL auto_increment, - link_url varchar(255) NOT NULL default '', - link_name varchar(255) NOT NULL default '', - link_image varchar(255) NOT NULL default '', - link_target varchar(25) NOT NULL default '', - link_category int(11) NOT NULL default 0, - link_description varchar(255) NOT NULL default '', - link_visible enum ('Y','N') NOT NULL default 'Y', - link_owner int NOT NULL DEFAULT '1', - link_rating int NOT NULL DEFAULT '0', - link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', - link_rel varchar(255) NOT NULL default '', - PRIMARY KEY (link_id) -) TYPE=MyISAM; - - --- DROP TABLE IF EXISTS linkcategories; -CREATE TABLE linkcategories ( - cat_id int(11) NOT NULL auto_increment, - cat_name tinytext NOT NULL, - auto_toggle enum ('Y','N') NOT NULL default 'N', - PRIMARY KEY (cat_id) -) TYPE=MyISAM; - -INSERT INTO linkcategories (cat_id, cat_name) VALUES (1, 'General'); - -INSERT INTO b2links (link_id, link_url, link_name, link_image, link_target, link_category, link_description, link_visible, link_owner) -VALUES (1, 'http://www.cafelog.com/', 'Cafelog', '', '_blank', 1, 'Cafelog', 'Y', 1); diff --git a/links.update-0.5.sql b/links.update-0.5.sql deleted file mode 100644 index 00788ad937..0000000000 --- a/links.update-0.5.sql +++ /dev/null @@ -1,34 +0,0 @@ --- -------------------------------------------------------- --- // $Id$ --- // --- // B2Links --- // Copyright (C) 2002 Mike Little -- mike@zed1.com --- // --- // This is an add-on to b2 weblog / news publishing tool --- // b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com --- // --- // ********************************************************************** --- // Copyright (C) 2002 Mike Little --- // --- // This program 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. --- // --- // This program 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 this program; if not, write to the Free Software --- // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --- // --- // Mike Little (mike@zed1.com) --- // ***************************************************************** - -alter table b2links modify column link_url varchar(255) NOT NULL default ''; --- this will have silently changed all the other chars to varchars! -alter table b2links add column link_description varchar(255) NOT NULL default ''; -alter table b2links add column link_visible enum ('Y','N') NOT NULL default 'Y'; -update b2links set link_description = link_name; diff --git a/links.update-0.7.sql b/links.update-0.7.sql deleted file mode 100644 index e2910532bd..0000000000 --- a/links.update-0.7.sql +++ /dev/null @@ -1,32 +0,0 @@ --- -------------------------------------------------------- --- // $Id$ --- // --- // B2Links --- // Copyright (C) 2002 Mike Little -- mike@zed1.com --- // --- // This is an add-on to b2 weblog / news publishing tool --- // b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com --- // --- // ********************************************************************** --- // Copyright (C) 2002 Mike Little --- // --- // This program 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. --- // --- // This program 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 this program; if not, write to the Free Software --- // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --- // --- // Mike Little (mike@zed1.com) --- // ***************************************************************** - -ALTER TABLE b2links ADD COLUMN link_owner INT NOT NULL DEFAULT '1'; --- set link owner to admin (id 1) -UPDATE b2links SET link_owner = 1; diff --git a/links.update-1.0.sql b/links.update-1.0.sql deleted file mode 100644 index 312d75d1ff..0000000000 --- a/links.update-1.0.sql +++ /dev/null @@ -1,33 +0,0 @@ --- -------------------------------------------------------- --- // $Id$ --- // --- // B2Links --- // Copyright (C) 2002 Mike Little -- mike@zed1.com --- // --- // This is an add-on to b2 weblog / news publishing tool --- // b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com --- // --- // ********************************************************************** --- // Copyright (C) 2002 Mike Little --- // --- // This program 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. --- // --- // This program 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 this program; if not, write to the Free Software --- // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --- // --- // Mike Little (mike@zed1.com) --- // ***************************************************************** - -ALTER TABLE b2links ADD COLUMN link_rating INT NOT NULL DEFAULT '0'; - -ALTER TABLE b2linkcategories ADD COLUMN auto_toggle enum ('Y','N') NOT NULL default 'N'; - diff --git a/links.update-1.3.sql b/links.update-1.3.sql deleted file mode 100644 index f87bdf2790..0000000000 --- a/links.update-1.3.sql +++ /dev/null @@ -1,33 +0,0 @@ --- -------------------------------------------------------- --- // $Id$ --- // --- // Links --- // Copyright (C) 2002 Mike Little -- mike@zed1.com --- // --- // This is an add-on to b2 weblog / news publishing tool --- // b2 is copyright (c)2001, 2002 by Michel Valdrighi - m@tidakada.com --- // --- // ********************************************************************** --- // Copyright (C) 2002 Mike Little --- // --- // This program 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. --- // --- // This program 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 this program; if not, write to the Free Software --- // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --- // --- // Mike Little (mike@zed1.com) --- // ***************************************************************** - -ALTER TABLE b2links ADD COLUMN link_updated DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'; -ALTER TABLE b2links ADD COLUMN link_rel varchar(255) NOT NULL DEFAULT ''; - - diff --git a/links.weblogs.com.php b/links.weblogs.com.php deleted file mode 100644 index eddc465de8..0000000000 --- a/links.weblogs.com.php +++ /dev/null @@ -1,147 +0,0 @@ - ''"; - $result = mysql_query($sql) - or die("Couldn't execute query. " . $sql . mysql_error()); - while ($row = mysql_fetch_object($result)) { - $all_links[$row->link_url] = array($row->link_id,0); - } -} - -/** - ** update_links() - ** Update in the db the links which have been updated ($all_links[url][1] != 0) - **/ -function update_links() { - global $tablelinks, $all_links; - dbconnect(); - - reset($all_links); - while (list($id, $val) = each($all_links)) { - if ($val[1]) { - $sql = "UPDATE $tablelinks SET link_updated = '$val[1]' WHERE link_id = $val[0] "; - //echo("executing: $sql\n"); - if (mysql_query($sql) == false) { - //ignore update errors! no data loss - //echo("Couldn't execute query. " . $sql . mysql_error()); - } - } - } // end while -} - -/** - ** get_weblogs_updatedfile() - ** Retrieves and caches a copy of the weblogs.com changed blogs xml file. - ** If the file exists check it's age, get new copy if old. - ** If a new or updated file has been written return true (needs processing) - ** otherwise return false (nothing to do) - **/ -function get_weblogs_updatedfile() { - global $weblogs_cache_file, $weblogs_xml_url, $weblogs_cacheminutes; - $update = false; - - if (file_exists($weblogs_cache_file)) { - // is it old? - $modtime = filemtime($weblogs_cache_file); - if ((time() - $modtime) > ($weblogs_cacheminutes * 60)) { - $update = true; - } - } else { // doesn't exist - $update = true; - } - - if ($update) { - // get a new copy - $contents = implode('', file($weblogs_xml_url)); // file_get_contents not available < 4.3 - $cachefp = fopen($weblogs_cache_file, "w"); - fwrite($cachefp, $contents); - fclose($cachefp); - } - return $update; -} - -/** - ** startElement() - ** Callback function. Called at the start of a new xml tag. - **/ -function startElement($parser, $tagName, $attrs) { - global $updated_timestamp, $all_links; - if ($tagName == 'WEBLOGUPDATES') { - //convert 'updated' into php date variable - $updated_timestamp = strtotime($attrs['UPDATED']); - //echo('got timestamp of ' . gmdate('F j, Y, H:i:s', $updated_timestamp) . "\n"); - } else if ($tagName == 'WEBLOG') { - // is this url in our links? - if (isset($all_links[$attrs['URL']])) { - $all_links[$attrs['URL']][1] = gmdate('YmdHis', $updated_timestamp - $attrs['WHEN']); - //echo('set link id ' . $all_links[$attrs['URL']][0] . ' to date ' . $all_links[$attrs['URL']][1] . "\n"); - } - } -} - -/** - ** endElement() - ** Callback function. Called at the end of an xml tag. - **/ -function endElement($parser, $tagName) { - // nothing to do. -} - - -// get/update the cache file. -// true return means new copy -if (get_weblogs_updatedfile()) { - - // pre-load the links - preload_links(); - - // Create an XML parser - $xml_parser = xml_parser_create(); - - // Set the functions to handle opening and closing tags - xml_set_element_handler($xml_parser, "startElement", "endElement"); - - // Open the XML file for reading - $fp = fopen($weblogs_cache_file, "r") - or die("Error reading XML data."); - - //echo('
');
-    // Read the XML file 4KB at a time
-    while ($data = fread($fp, 4096)) {
-        // Parse each 4KB chunk with the XML parser created above
-        xml_parse($xml_parser, $data, feof($fp))
-                // Handle errors in parsing
-                or die(sprintf("XML error: %s at line %d",
-                               xml_error_string(xml_get_error_code($xml_parser)),
-                               xml_get_current_line_number($xml_parser)));
-    }
-    
-    // Close the XML file
-    fclose($fp);
-
-    // Free up memory used by the XML parser
-    xml_parser_free($xml_parser);
-
-    // now update the db with latest times
-    update_links();
-
-    //echo('
'); -} // end if updated cache file -?> diff --git a/b2-include/b2.css b/wp-admin/b2.css similarity index 100% rename from b2-include/b2.css rename to wp-admin/b2.css diff --git a/wp-admin/b2edit.php b/wp-admin/b2edit.php index 91db68c0f8..ad949d3dc6 100644 --- a/wp-admin/b2edit.php +++ b/wp-admin/b2edit.php @@ -346,4 +346,4 @@ default: /* */ include("b2footer.php"); -?> \ No newline at end of file +?> diff --git a/wp-admin/b2header.php b/wp-admin/b2header.php index 07b2c4f145..cc58693f43 100644 --- a/wp-admin/b2header.php +++ b/wp-admin/b2header.php @@ -2,7 +2,7 @@ require_once("../b2config.php"); require_once($b2inc."/b2template.functions.php"); -require_once($b2inc."/b2verifauth.php"); +require_once("b2verifauth.php"); require_once($b2inc."/b2vars.php"); require_once($b2inc."/b2functions.php"); require_once($b2inc."/xmlrpc.inc"); @@ -156,4 +156,4 @@ if ($profile==0) { \ No newline at end of file +?> diff --git a/wp-admin/b2menutop.php b/wp-admin/b2menutop.php index 308381a3cf..8a56f19d32 100644 --- a/wp-admin/b2menutop.php +++ b/wp-admin/b2menutop.php @@ -7,7 +7,7 @@ if ($pagenow != "b2profile.php") { -$menu = file("b2menutop.txt"); +$menu = file("./b2menutop.txt"); $i=0; $j=$menu[0]; while ($j != "") { diff --git a/b2-include/b2menutop.txt b/wp-admin/b2menutop.txt similarity index 100% rename from b2-include/b2menutop.txt rename to wp-admin/b2menutop.txt diff --git a/wp-admin/b2profile.php b/wp-admin/b2profile.php index 95ecf50846..40cd9d74ad 100644 --- a/wp-admin/b2profile.php +++ b/wp-admin/b2profile.php @@ -43,7 +43,7 @@ switch($action) { case "update": - require_once("$b2inc/b2verifauth.php"); + require_once("b2verifauth.php"); get_currentuserinfo(); @@ -114,7 +114,7 @@ break; case "viewprofile": - require_once("$b2inc/b2verifauth.php"); + require_once("b2verifauth.php"); /* $profile=1; get_currentuserinfo(); diff --git a/b2-include/b2quicktags.js b/wp-admin/b2quicktags.js similarity index 100% rename from b2-include/b2quicktags.js rename to wp-admin/b2quicktags.js diff --git a/wp-admin/b2template.php b/wp-admin/b2template.php index 7ddaf9be86..91656d4e31 100644 --- a/wp-admin/b2template.php +++ b/wp-admin/b2template.php @@ -1,5 +1,5 @@ */ function add_magic_quotes($array) { diff --git a/wp-admin/linkcategories.php b/wp-admin/linkcategories.php index 43ec2b41b3..6649949034 100644 --- a/wp-admin/linkcategories.php +++ b/wp-admin/linkcategories.php @@ -73,7 +73,6 @@ switch ($action) { { $standalone = 1; include_once("./b2header.php"); - include_once("./links.php"); $cat_id = $HTTP_POST_VARS["cat_id"]; $cat_name=get_linkcatname($cat_id); @@ -97,7 +96,6 @@ switch ($action) { case "Edit": { include_once ("./b2header.php"); - include_once("./links.php"); $cat_id = $HTTP_POST_VARS["cat_id"]; $cat_name=get_linkcatname($cat_id); $cat_name=addslashes($cat_name);