includes/namespaces/file.php
changeset 1277 4264ace0855f
parent 1227 bdac73ed481e
child 1309 2a14b5a25338
equal deleted inserted replaced
1276:dac5fad7ad6a 1277:4264ace0855f
   186 				$html .= '<br />';
   186 				$html .= '<br />';
   187 			}
   187 			}
   188 			$html .= '</p>';
   188 			$html .= '</p>';
   189 		}
   189 		}
   190 		$db->free_result();
   190 		$db->free_result();
       
   191 		$html .= '<h3>' . $lang->get('onpage_filebox_lbl_pagesusing') . '</h3>';
       
   192 		$q = $db->sql_query('SELECT t.page_id, t.namespace, p.name FROM ' . table_prefix . "page_text AS t\n"
       
   193 			              . "  LEFT JOIN enano_pages AS p\n"
       
   194 			              . "    ON ( t.page_id = p.urlname AND t.namespace = p.namespace )\n"
       
   195 			              . "  WHERE t.page_text REGEXP '\\\\[\\\\[:" .
       
   196 							  addslashes(preg_quote($paths->nslist[$this->namespace])) .
       
   197 							  addslashes(preg_quote($this->page_id)) .
       
   198 							  "(\\\\||\\\\])';");
       
   199 		if ( !$q )
       
   200 			$db->_die();
       
   201 		
       
   202 		if ( $db->numrows() < 1 )
       
   203 		{
       
   204 			$html .= '<p>' . $lang->get('onpage_filebox_msg_no_inlinks') . '</p>';
       
   205 		}
       
   206 		else
       
   207 		{
       
   208 			$html .= '<p>' . $lang->get('onpage_filebox_msg_pagesusing') . '</p>';
       
   209 			$html .= '<ul>';
       
   210 			while ( $row = $db->fetchrow() )
       
   211 			{
       
   212 				$html .= '<li><a href="' . makeUrlNS($row['namespace'], $row['page_id']) . '">' .
       
   213 							htmlspecialchars($row['name']) .
       
   214 							'</a></li>';
       
   215 			}
       
   216 			$html .= '</ul>';
       
   217 		}
       
   218 		$db->free_result();
   191 		$html .= '</div><br />';
   219 		$html .= '</div><br />';
   192 		return $html;
   220 		return $html;
   193 	}
   221 	}
   194 	
   222 	
   195 	/**
   223 	/**