Hey. I was thinking, I hated seeing short and long pages go. I have an
idea for returning them.. i dont feel like explaining in english, so i
hop you understand...
ALTER TABLE `cur` ADD `art_len` MEDIUMINT UNSIGNED;
ALTER TABLE `cur` ADD INDEX ( `art_len` ) ;
/////ARTICLE.PHP -- insertNewARticle()
replace :
$sql = "UPDATE cur SET cur_text='" . wfStrencode( $text ) .
"',cur_comment='" . wfStrencode( $summary ) .
"',cur_minor_edit={$me2}, cur_user=" . $wgUser->getID() .
",cur_timestamp='{$now}',cur_user_text='" .
wfStrencode( $wgUser->getName() ) .
"',cur_is_redirect={$redir}, cur_is_new=0,
cur_touched='{$now}', inverse_timestamp='{$won}' " .
"WHERE cur_id=" . $this->getID();
with this:
$sql = "UPDATE cur SET cur_text='" . wfStrencode( $text ) .
"',cur_comment='" . wfStrencode( $summary ) .
"',cur_minor_edit={$me2}, cur_user=" . $wgUser->getID() .
",cur_timestamp='{$now}',cur_user_text='" .
wfStrencode( $wgUser->getName() ) .
+ ",art_len=".strlen($text).
"',cur_is_redirect={$redir}, cur_is_new=0,
cur_touched='{$now}', inverse_timestamp='{$won}' " .
"WHERE cur_id=" . $this->getID();
/////SPECIALLONGPAGES.PHP ~line 21
from
$sql = "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
"WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY " .
"LENGTH(cur_text) DESC LIMIT {$offset}, {$limit}";
to:
$sql = "SELECT cur_title, art_len AS len FROM cur " .
"WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY " .
"art_len DESC LIMIT {$offset}, {$limit}";
Whats everyone think? Yes yes I know it involved adding another column
and an index.. but those pages really were usefull... I mean, at least
I thought they were... and I know its kind of hackish.. but there's no
reason not too try it. If we implement it early in the other wikipedias
it saves the cost of doing a huge alter table.. and it lets them keep
those 2 special pages even if they grow a lot like the english wiki
Lightning