Hi y'all,
since two days ago, i can' t see the characters of this site;
perhaps, I am missing something. Must I reconfigure my browser in other way?. Maybe is anything local, mine?
Thanks in advance.
-- 80.58.205.54 2007-8-11 8:38 pm
Hi.
I haven't changed any setting of this site recently. I don't know the reason of your problem, sorry. I just guess that you'd better check your font setting.
I understand that your suggestion is:
When viewing old revision of a page, double clicking goes to "edit this revision", rather than "edit current version"
Am I right? I think your suggestion makes sense. I'll edit wiki source as soon as possible.
기타분류
내 한국어 능력에 대한 죄송합니다, 내가 여기서 멀리 떨어져 살아! :O
I would like suggest something like this for DoubleClick feature (sorry if there are mistakes but I try to express the idea):
내가 좋아하는 UseMod 0.92K3감사합니다!
Hi to all,
1) I'm doing another usemodkr + usemod merge. For this occasion I decided to save these files as meta-values. "Cnt" into the same directory than the pages (as the old .. "lck" of primal usemod. I thought so you can save operations, mainten not have to create new directories neither to be declarated before (fewer operations).
I can understand that this proposal can not to be put in production (makes it impossible to migrate without a converter script). But I wanted to comment like another point of view. (I can not talk about this to my neighbor, I'm not sure that he can understand me :))).
2) Again, there's interesting inputs from Usemodkr. for instance, about ". cnt files. I have made a contribution in my wiki, with this snippet that is for "previous viewed" that saves the last time that it was seen. It seems work fine.
Greetings.
--JuanmaMP (aka, The foreigner:)) (I have not really traveled much, so I enjoy this appellation is a new experience!)
Yes, you're right. There are no important reason to place ".cnt" files in the different directory. I can't remember exactly, but maybe I decided to do so because...:
1) When I added "page hit counter" feature, I was just a Perl newbie and I didn't know the entire structure of the source code of usemod. (And I don't know now, either ^^) So I just referred to the way that original usemod save the keep files (".kp"). They are saved in "keep" directory, so .cnt files are saved "count" directory. :-)
2) As I modified Usemodkr, I had to check that metafiles were created, modified, and removed correctly by wiki operation. I checked it using terminal and shell command (like ls, cd etc.) Therefore, it was easier for me to check it when files are stored in a different directory than when they are in the same directory.
Thanks for good pointing.
Yes, indeed, keep files can be stored in the same "pages" directory, too. Perhaps, the original one is a more readable decision.
Thanks to you.
EditIntermap
I like this feature: edit Intermap via web. I have re-used editbanned code with other point of view, and that's all.
For instance, after sub DoUpdateBanned (completely optional):
+ sub DoEditIntermap {
+ my ($intermapList, $status);
+
+ print &GetHeader("", "Editing IntermapList", "");
+ print "\n";
+ return if (!&UserIsAdminOrError());
+ ($status, $intermapList) = &ReadFile("$DataDir/intermap");
+ $intermapList = "" if (!$status);
+ print &GetFormStart();
+ print GetHiddenValue("edit_intermap", 1), "\n";
+ print &GetTextArea('intermaplist', $intermapList, 12, 100);
+ print "<br>", $q->submit(-name=>'Save'), "\n";
+ print $q->endform;
+ print '</div>' . &GetCommonFooter();
+ }
+
+ sub DoUpdateIntermap {
+ my ($newList, $fname);
+
+ print &GetHeader("", "Updating Intermap list", "");
+ return if (!&UserIsAdminOrError());
+ $fname = "$DataDir/intermap";
+ $newList = &GetParam("intermaplist", "#Empty file");
+ if ($newList eq "") {
+ print "<p>Empty intermap list or error.";
+ print "<p>Resubmit with at least one space character to remove.";
+ } elsif ($newList =~ /^\s*$/s) {
+ unlink($fname);
+ print "<p>Removed intermap list";
+ } else {
+ &WriteStringToFile($fname, $newList);
+ print "<p>Updated intermap list";
+ }
+ print '</div>' . &GetCommonFooter();
+ }
Sub GetAdminBar {
....
$result .= &ScriptLink("action=editbanned", T("Edit Banned List"));
+ $result .= ' | ' . &ScriptLink("action=editintermap",T("Intermap"));
...
}
Sub DoOtherRequest {
...
} elsif ($action eq "editbanned") {
&DoEditBanned();
+ } elsif ($action eq "editintermap") {
+ &DoEditIntermap();
...
sub DoOtherRequest {
...
if (&GetParam("edit_ban", 0)) {
&DoUpdateBanned();
return;
}
+ if (&GetParam("edit_intermap", 0)) {
+ &DoUpdateIntermap();
+ return;
+ }
please, can you delete one more time JuanmaMP.db?. I had experienced difficulties in order to login. And sorry :(.
A related idea about sessions: In my script, I have this change:
} elsif ($action eq "newlogin") {
- $UserID = 0;
# $SUserID = 0;
- &DoEditPrefs(); # Also creates new ID
+ &DoNewLogin();
The DoNewLogin is modified too, from original patch of usemod site, so, DoSaveLogin is too modified. The goal is no change about IDs, until successfully login. (Someone can go to newlogin action for nothing and then he leaves it, for instance).
Thanks and it hope it helps.
A broader view of this variety of wiki is, on the one hand, doing pages with different status, depending on the criteria when they were created: wikified (wiki) or "postified" (post). Then, user can live with these two types of data; but it can be canceled one of them or not (like you). Subroutines as "PageAsDate", "NodeIsAuth", and others can discriminate wiki-pages, post-pages, even home-pages.
So, for instance, indexing schemes (most viewed, most versioned, last visit, last revision, etc.), can show results for only wiki-style pages or blog-style pages. Also, the site wide searches can be limited to nodes according to the nature of them.
This afternoon in GMT, I will put other snapshots for these purposes and other utilities.
It makes me glad if you liked this beginning of pictures!.
As curiosity, this guy, http://nmr.mgh.harvard.edu/~fangq/ achieved to hack UseMod to connect with databases. I know, it wasn't the philosophy of UseMod, the simplest online database that could possibly work, and today there are as many kinds of software for web sites with databases, but it is another interesting fork of the quarry UseMod. Currently, The site does not seems available: http://wenq.org/habitat. But the software can be downloaded at sourceforge: http://sourceforge.net/projects/huc/files%2FHabitat%2F0.2.1/
I have erased the screenshots, until my code can be functional on the web.
I would like explain that I uploaded these with humorous, with hoping not to disturb!. Right?
Another curiosity: on CPAN there is a module that calculates sunrise!.
I have planned to make two css (one dark, one lighter) that are activated depending on whether it is day or night, automatically :))
For instance: perl -le 'use Astro::Sunrise; print sun_set(-4.7, 47.4).
By the way, today is a holiday here (Corpus Christi).
Regards.
Yes, it's not critical. (Then, it's not urgent :) ).
As far as I'm concerned, don't worry for fixing. I live this as a fun hobby, you know ... .
Fun is a feature (worry is a bug).
Regards and thanks.
$lastTs = $ts, last if not PageIsHidden($page);
It can be pass along the whole lines of rclog, and all the pages as hidden, then the "bucle for" stops in the last entry, (it can be hidden page or not).
Then,
<tt>
# Only false if no lines in file
if (@fullrc > 0) {
+ my ($ts, $page);
for (my $i = $#fullrc; $i >= 0; $i--) {
- my ($ts, $page) = split(/$FS3/, $fullrc[$i]);
+ ($ts, $page) = split(/$FS3/, $fullrc[$i]);
$lastTs = $ts, last if not PageIsHidden($page);
}
+ $lastTs = 0 if (PageIsHidden($page));
}
</tt>
and,
<tt>
- if (!&LoginUser()) {
+ if (!&LoginUser() && $lastTs > 1) {
</tt>
Not still tested. I will notify, as long as when I can having more tests.
I think that this line:
+ $lastTs = 0 if (PageIsHidden($page));
is not necessary, because lastTs is initialized to be 0 before for loop,
and if all pages are hidden, lastTs would not be overwritten in loop.
I meant that, the bucle "for" stops if matching a not hidden page. But "for" can arrive at the end (there is not "last") and capture $ts of last page (hidden or not). Then if is Page is not hidden, = 0 (not $ts). Am I wrong?
I think you are right.
$lastTs = $ts, last if not PageIsHidden($page);
it's the same that
if (not PageIsHidden($page)) {$lastTs = $ts, last;}.
Ok. Sorry.
(Mistake: "bucle" is loop in spanish)
Good afternoon over there.
When I typing "Something like this" in the browser address field. Then it it passes to %-encoded (Something%20Like%20this), and Title in page on wiki shows: "Something".
I was reading http://www.emacswiki.org/alex/2012-07-20_Perl_and_UTF-8 but still is a nightmare for me :).
The new version of Oddumse has this:
sub GetId {
my $id = UnquoteHtml(GetParam('id', GetParam('title', ''))); # id=x or title=x -> x
if (not $id) {
my @keywords = $q->keywords;
foreach my $keyword (@keywords) {
utf8::decode($keyword);
}
$id = join('_', @keywords) unless $id; # script?p+q -> p_q
}
if ($UsePathInfo) {
my $path = $q->path_info;
utf8::decode($path);
my @path = split(/\//, $path);
$id = pop(@path) unless $id; # script/p/q -> q
foreach my $p (@path) {
SetParam($p, 1); # script/p/q -> p=1
}
}
return $id;
}
but we don't have "sub GetId".
In my local wiki I have put this, and it seeems to work fine:
<pre>
sub GetHead {
my ($id, $title, $oldId) = @_;
my ($status, $altname);
my $header = "";
my $logoImage = "";
my $logoTitle = "";
my $result = "";
my $embed = &GetParam('embed', '');
my $altText = T('[Home]');
my ($revision, $goodRevision);
my ($action, $username);
my (@id, $name);
my ($showDiff);
my $i;
+ if (grep/%20/, $ENV{QUERY_STRING}) {
+ my @keywords = $q->keywords;
+ foreach my $keyword (@keywords) {
+ utf8::decode($keyword);
+ }
+ $id = join('_', @keywords); # script?p+q -> p_q
+ }
and in your wiki, too, and then converts to "Something_Like_This".
it seems to work fine. Do not ask me why :(
There's almost a bug, ... there's almost a patch/fix.
I need other life only for UTF and Encoding.
Good lucky.
Hi, from the other point of planet :)
A fix, in order to clean of useless folders after delete pages (yes, it's extensible for CountDir, LinkDir, KeepDir, Upload)
sub DeletePage {
...
### lck 화일도 같이 삭제
$fname = &GetLockedPageFile($page);
unlink($fname) if (-f $fname);
+ my $main = $page;
+ $main =~ s|/.*||; # Only the main page name (remove subpage)
+ rmdir "$PageDir . '/' . &GetPageDirectory($page) . '/' . $main";
...
I doubt this code could try to delete "non-empty directory". For example, if there were two page "A/a" and "A/b" and admin deleted "A/a", this code would try to remove "A" directory and would fail because "A/b.db" file would still exist.
Hi Raymundo,
I am thinking that "\n" should not to be added, if string is a section because "\n" is for only end of file. Isn't it?
sub DoPostMain {
...
# Add a newline to the end of the string (if it doesn't have one)
- $string .= "\n" if (!($string =~ /\n$/));
my $section = GetParam('section', ''); (# moved from bottom, at original script)
+ $string .= "\n" if (not $string =~ /\n$/ and not $section);
I added "\n" to the end of string from TextArea in Sub doEdit. It added unnecessary noise at Recent Changes and revisions. But It only happens in my patched script. It's because sub doedit (not sub dopostmain, that's I believed). Sorry for the inconvenience. Have a good sunday.
But almost user requests are action involving page, aren't they? Page browsing, page editing, viewing history, viewing diff, etc. Only a very few exceptions, like admin menu or login and logout, aren't. I doubt if it is better or not to move that code to PageIsHidden. If I moved it there, that code would be executed several times per one request.
There is JuanmaMP already. :-D
I understand that your suggestion is:
When viewing old revision of a page, double clicking goes to "edit this revision", rather than "edit current version"
Am I right? I think your suggestion makes sense. I'll edit wiki source as soon as possible.
yes, you're right. It's just what I mean.
Congrats for your scripts!. Best Regards.
(By the way JuanmaMP and JustSameJuanmaMP are the same guy) :)
I just meant that you can use JuanmaMP as your page, that is, you don't need to create a new page everytime you visit here ^_^.
Anyway (now, more seriously), It's an honour participating here.
Thanks for implementing.
(Sorry, I forget my previous passwords, so I have scored this)