Changeset 2789730
- Timestamp:
- 09/24/2022 08:36:17 PM (3 years ago)
- Location:
- uqrate/trunk
- Files:
-
- 5 edited
-
class.core.php (modified) (1 diff)
-
class.sync.php (modified) (5 diffs)
-
uqrate.php (modified) (1 diff)
-
views/js/a.base.js (modified) (1 diff)
-
views/js/p.base.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uqrate/trunk/class.core.php
r2789063 r2789730 101 101 global $post; 102 102 $state->comment_status = $post->comment_status; 103 $state->guid = $post->guid; 104 $state->uri = self::reqURI(); 103 105 } 104 106 return $content 105 107 . self::preObj( $state, 'state' ); 108 } 109 protected static function reqURI() { 110 return sanitize_url( $_SERVER['REQUEST_URI'] ); 106 111 } 107 112 private static function okayCommentsSection() { -
uqrate/trunk/class.sync.php
r2789063 r2789730 61 61 } 62 62 } else { 63 if ( self::getMID( $post->guid, $post->post_date_gmt) ) {63 if ( self::getMID() ) { 64 64 $mid = self::cfg('mid'); 65 65 $sql = "INSERT IGNORE INTO $table_name ( … … 167 167 'body' => $post->post_content, 168 168 'date_update' => $date, 169 ' host_url' => get_permalink(),169 'uri' => self::reqURI(), 170 170 ]; 171 171 if ( $post->post_excerpt ) $msg['summary'] = $post->post_excerpt; … … 225 225 return true; 226 226 } 227 private static function getMID( $post_guid, $post_date_gmt) {227 private static function getMID() { 228 228 /********************************************************************** 229 229 * Get the cross-app message id (MID) : UUIDv5 of OID namespace … … 242 242 $mid = 'UUID_NAME_FAIL'; 243 243 if ( ! self::GetChnKey() ) return false; 244 if ( ! ( $post_date_gmt && self::cfg('chn_key')['chn_id'] ) ) { 244 $cid = self::cfg('chn_key')['chn_id']; 245 $uri = self::reqURI(); 246 if ( ! ( $cid && $uri ) ) { 245 247 self::cfg()['mid'] = $mid; 246 248 self::errWrap( 'missing source(s)', __FUNCTION__ ); … … 249 251 $mid = 'UUID_MALFORMED'; 250 252 $code = 0; 251 /******************************************************** 252 * Set a site-unique, static source (name) for UUIDv5 253 * 254 * name : <REQUEST_URI><CHANNEL_ID>/<TIMESTAMPz> 255 * 256 * The MID may be generated by any UUIDv5-encoding 257 * function that knows to decode the url-encoded name 258 * and use the OID namespace. 259 *******************************************************/ 260 $name = sanitize_url( $_SERVER['REQUEST_URI'] ) 261 . self::cfg('chn_key')['chn_id'] . '/' 262 . self::rfc3339z( $post_date_gmt ); 263 $url = self::cfg('base_mid_url') . urlencode( $name ); 253 $url = self::cfg('base_mid_url') . urlencode( $cid . $uri ); 264 254 self::cfg()['url'] = $url; 265 255 $resp = wp_remote_get( $url ); -
uqrate/trunk/uqrate.php
r2789063 r2789730 29 29 define( 'UQRATE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 30 30 $_UQRATE_ENV = [ 31 'build' => "2022-09-2 2T19.47.58Z",31 'build' => "2022-09-24T20.30.44Z", 32 32 'mode_debug' => false, 33 33 'mode_local' => false, -
uqrate/trunk/views/js/a.base.js
r2786655 r2789730 8 8 ver = '1.0.0' 9 9 ,debug = true 10 ,log_ctx = `𝕎 [${(new Date()).toISOString().substring(17)}] [v${ver}]` 11 ,log = (arg, ...args) => debug && console.log(log_ctx, arg, ...args) 10 ,log = (arg, ...args) => debug && console.log( 11 `𝕎 [${(new Date()).toISOString().substring(17)}] [v${ver}]` 12 ,arg, ...args 13 ) 12 14 ,css = (selector, root) => { 13 15 root = root ? root : document -
uqrate/trunk/views/js/p.base.js
r2786655 r2789730 8 8 ver = '1.0.0' 9 9 ,debug = true 10 ,log_ctx = `𝐖 [${(new Date()).toISOString().substring(17)}] [v${ver}]` 11 ,log = (arg, ...args) => debug && console.log(log_ctx, arg, ...args) 10 ,log = (arg, ...args) => debug && console.log( 11 `𝐖 [${(new Date()).toISOString().substring(17)}] [v${ver}]` 12 ,arg, ...args 13 ) 12 14 ,id = (id) => document.getElementById(id) 13 15 ,css = (selector, root) => {
Note: See TracChangeset
for help on using the changeset viewer.