author | Dan |
Mon, 07 Jul 2008 04:02:18 -0400 | |
changeset 10 | 219a0133622e |
parent 8 | 160f1170aa32 |
permissions | -rw-r--r-- |
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
1 |
<?php |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
2 |
/* |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
3 |
Plugin Name: Nuggie |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
4 |
Plugin URI: http://enanocms.org/Nuggie |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
5 |
Description: Nuggie provides a complete blogging suite for Enano-based websites. Named after Scottish water sprites. |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
6 |
Author: Dan Fuhry |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
7 |
Version: 0.1 |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
8 |
Author URI: http://enanocms.org/ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
9 |
*/ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
10 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
11 |
/* |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
12 |
* Nuggie |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
13 |
* Version 0.1 |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
14 |
* Copyright (C) 2007 Dan Fuhry |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
15 |
* |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
16 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
17 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
18 |
* |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
19 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
20 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
21 |
*/ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
22 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
23 |
global $db, $session, $paths, $template, $plugins; // Common objects |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
24 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
25 |
if ( getConfig('nuggie_installed') != '1' ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
26 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
27 |
$plugins->attachHook('base_classes_initted', ' |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
28 |
$paths->add_page(Array( |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
29 |
\'name\'=>\'Install Nuggie\', |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
30 |
\'urlname\'=>\'NuggieInstall\', |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
31 |
\'namespace\'=>\'Special\', |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
32 |
\'special\'=>0,\'visible\'=>0,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
33 |
)); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
34 |
'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
35 |
require( ENANO_ROOT . '/plugins/nuggie/install.php' ); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
36 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
37 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
38 |
$plugins->attachHook('base_classes_initted', ' |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
39 |
list($page_id, $namespace) = RenderMan::strToPageId($paths->get_pageid_from_url()); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
40 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
41 |
if ( $page_id == "Preferences" && $namespace == "Special" ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
42 |
{ |
3
a050ff3d4509
Added the post manager. It uses AJAX. And it's pretty. At least a little. And it rips Wordpress.
Dan
parents:
2
diff
changeset
|
43 |
$template->add_header("<link rel=\"stylesheet\" type=\"text/css\" href=\"' . scriptPath . '/plugins/nuggie/client/usercp.css\" />"); |
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
44 |
require( ENANO_ROOT . "/plugins/nuggie/usercp.php" ); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
45 |
} |
2 | 46 |
else if ( $page_id == "Search" && $namespace == "Special" ) |
47 |
{ |
|
48 |
require( ENANO_ROOT . "/plugins/nuggie/search.php" ); |
|
49 |
} |
|
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
50 |
'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
51 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
52 |
$plugins->attachHook('acl_rule_init', 'nuggie_namespace_setup();'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
53 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
54 |
function nuggie_namespace_setup() |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
55 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
56 |
global $db, $session, $paths, $template, $plugins; // Common objects |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
57 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
58 |
// Insert additional namespaces |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
59 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
60 |
$paths->create_namespace('Blog', 'Blog:'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
61 |
$paths->create_namespace('Planet', 'Planet:'); |
7
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
62 |
$paths->create_namespace('BlogPost', 'Blog_post:'); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
63 |
|
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
64 |
// Register namespace processors |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
65 |
$paths->register_namespace_processor('BlogPost', 'nuggie_blogpost_uri_handler'); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
66 |
$paths->register_namespace_processor('Planet', 'nuggie_planet_uri_handler'); |
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
67 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
68 |
// Create custom permissions for Nuggie |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
69 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
70 |
$session->register_acl_type('nuggie_post', AUTH_DISALLOW, 'Post blog entries or create blog', Array(), 'Blog'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
71 |
$session->register_acl_type('nuggie_edit_own', AUTH_DISALLOW, 'Edit own blog posts', Array(), 'Blog'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
72 |
$session->register_acl_type('nuggie_edit_other', AUTH_DISALLOW, 'Edit others\' blog posts', Array(), 'Blog'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
73 |
$session->register_acl_type('nuggie_create_planet', AUTH_DISALLOW, 'Create new planets', Array(), 'Planet'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
74 |
$session->register_acl_type('nuggie_publicize_planet', AUTH_DISALLOW, 'Make own planets searchable', Array('nuggie_create_planet'), 'Planet'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
75 |
$session->register_acl_type('nuggie_protect_planet', AUTH_DISALLOW, 'Protect planets from public modification', Array(), 'Planet'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
76 |
$session->register_acl_type('nuggie_edit_planet_own', AUTH_DISALLOW, 'Edit own planets', Array(), 'Planet'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
77 |
$session->register_acl_type('nuggie_edit_planet_other', AUTH_DISALLOW, 'Edit others\' planets', Array(), 'Planet'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
78 |
$session->register_acl_type('nuggie_even_when_protected', AUTH_DISALLOW, 'Override protection on editing planets', Array(), 'Planet'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
79 |
$session->register_acl_type('nuggie_see_non_public', AUTH_DISALLOW, 'See non-public blogs', Array(), 'Blog'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
80 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
81 |
// Extend the core permission set |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
82 |
|
7
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
83 |
$session->acl_extend_scope('read', 'Blog|Planet|BlogPost', $paths); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
84 |
$session->acl_extend_scope('edit_comments', 'BlogPost', $paths); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
85 |
$session->acl_extend_scope('post_comments', 'BlogPost', $paths); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
86 |
$session->acl_extend_scope('mod_comments', 'BlogPost', $paths); |
8
160f1170aa32
First commit with working planet presentation code. No UI written for planet management yet.
Dan
parents:
7
diff
changeset
|
87 |
$session->acl_extend_scope('tag_create', 'BlogPost', $paths); |
160f1170aa32
First commit with working planet presentation code. No UI written for planet management yet.
Dan
parents:
7
diff
changeset
|
88 |
$session->acl_extend_scope('tag_delete_own', 'BlogPost', $paths); |
160f1170aa32
First commit with working planet presentation code. No UI written for planet management yet.
Dan
parents:
7
diff
changeset
|
89 |
$session->acl_extend_scope('tag_delete_other', 'BlogPost', $paths); |
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
90 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
91 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
92 |
$plugins->attachHook('page_type_string_set', 'nuggie_set_page_string();'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
93 |
|
8
160f1170aa32
First commit with working planet presentation code. No UI written for planet management yet.
Dan
parents:
7
diff
changeset
|
94 |
require( ENANO_ROOT . '/plugins/nuggie/constants.php' ); |
7
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
95 |
require( ENANO_ROOT . '/plugins/nuggie/planet.php' ); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
96 |
require( ENANO_ROOT . '/plugins/nuggie/postbit.php' ); |
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
97 |
|
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
98 |
function nuggie_set_page_string() |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
99 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
100 |
global $db, $session, $paths, $template, $plugins; // Common objects |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
101 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
102 |
if ( $paths->namespace == 'Blog' ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
103 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
104 |
$paths->cpage['comments_on'] = 0; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
105 |
$template->namespace_string = 'blog'; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
106 |
if ( strstr($paths->cpage['urlname_nons'], '/') ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
107 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
108 |
$paths->cpage['comments_on'] = 1; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
109 |
$template->namespace_string = 'blog post'; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
110 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
111 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
112 |
else if ( $paths->namespace == 'Planet' ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
113 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
114 |
$paths->cpage['comments_on'] = 0; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
115 |
$template->namespace_string = 'planet'; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
116 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
117 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
118 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
119 |
$plugins->attachHook('page_not_found', 'nuggie_handle_namespace($this);'); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
120 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
121 |
function nuggie_handle_namespace($processor) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
122 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
123 |
global $db, $session, $paths, $template, $plugins; // Common objects |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
124 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
125 |
if ( $processor->namespace == 'Blog' ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
126 |
{ |
7
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
127 |
$result = nuggie_blog_uri_handler($processor); |
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
128 |
if ( $result === '_err_access_denied' ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
129 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
130 |
$processor->err_access_denied(); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
131 |
return true; |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
132 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
133 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
134 |
else if ( $processor->namespace == 'Planet' ) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
135 |
{ |
7
cd46e29ae699
Started work on planet system. From this point onward, enano-1.1 rev 571 or later required.
Dan
parents:
3
diff
changeset
|
136 |
// revision 7: never called anymore |
0
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
137 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
138 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
139 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
140 |
/** |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
141 |
* Sanitizes a string for a Nuggie permalink. |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
142 |
* @param string String to sanitize |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
143 |
* @return string |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
144 |
*/ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
145 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
146 |
function nuggie_sanitize_title($title) |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
147 |
{ |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
148 |
// Placeholder for now - this may become more elaborate in the future, we'll see |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
149 |
return sanitize_page_id($title); |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
150 |
} |
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
151 |
|
a09fb41e48d5
First commit! Woohoo! Basic status of things is in extended description.
Dan
parents:
diff
changeset
|
152 |
?> |