File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,19 @@ public static function gen_all_url()
5858 foreach ($ articles AS $ article ) {
5959 $ type = $ article ['type ' ];
6060 $ routeExists = (NULL != Typecho_Router::get ($ type ));
61+ if (!is_null ($ routeExists )){
62+ $ article ['categories ' ] = $ db ->fetchAll ($ db ->select ()->from ('table.metas ' )
63+ ->join ('table.relationships ' , 'table.relationships.mid = table.metas.mid ' )
64+ ->where ('table.relationships.cid = ? ' , $ article ['cid ' ])
65+ ->where ('table.metas.type = ? ' , 'category ' )
66+ ->order ('table.metas.order ' , Typecho_Db::SORT_ASC ));
67+ $ article ['category ' ] = urlencode (current (Typecho_Common::arrayFlatten ($ article ['categories ' ], 'slug ' )));
68+ $ article ['slug ' ] = urlencode ($ article ['slug ' ]);
69+ $ article ['date ' ] = new Typecho_Date ($ article ['created ' ]);
70+ $ article ['year ' ] = $ article ['date ' ]->year ;
71+ $ article ['month ' ] = $ article ['date ' ]->month ;
72+ $ article ['day ' ] = $ article ['date ' ]->day ;
73+ }
6174 $ article ['pathinfo ' ] = $ routeExists ? Typecho_Router::url ($ type , $ article ) : '# ' ;
6275 $ urls [] = Typecho_Common::url ($ article ['pathinfo ' ], $ options ->index );
6376 }
You can’t perform that action at this time.
0 commit comments