2007: 유감스러운, 나는 한국어 언어를 모른다
2004: 또한, 저는 Perl을 몰랐다
2012: (자, 두 언어를 조금 알고)
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.
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.
Then I'll check my config.
(Just as I can't see fonts in http://ko.wikipedia.org for instance)
Thanks for the info. --JuanmaMP
I hope it help to spread UseModWiki소스수정 -- JuanmaMP
이 자리에 JustSameJuanmaMP 페이지의 내용을 적은 후에 아래의 분류를 적절히 지정해주세요. 마땅한 분류가 없다면 그냥 기타분류로 놓아 두세요.
I would like suggest something like this for DoubleClick feature (sorry if there are mistakes but I try to express the idea):
sub GetHtmlHeader { ... + $revision = &GetParam('revision', ''); + if ($revision && &UserCanEdit($id,0)) { + $bodyExtra .= qq| ondblclick="location.href='$ScriptName${\&ScriptLinkChar()}action=edit&id=$id&revision=$revision'"|; +} else { + $bodyExtra .= qq| ondblclick="location.href='$ScriptName${\&ScriptLinkChar()}action=edit&id=$id'" |; }내가 좋아하는 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.
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; + }
If the script runs as "www-data", then the wikidb, etc. files must also be owned by "www-data", (apache2 runs as user www-data, for instance). See the documentation of your web server for details.
(Sorry for readers of UseModWiki, it's duplicated there. I hope it isn't annoyance)
Hope it's fun!.
--JuanmaMP
Just for test:
Samples of links: .TestForLinks
To:
.... Diary/301동식당의미스테리
JuanmaMP
SandBox
Sandbox
.... UseModWiki소스수정/AllPagesTo매크로
.... UseModWiki소스수정/GetFullLinkList함수
.... UseModWiki소스수정/goto매크로버그
.... UseModWiki소스수정/문자열일괄치환
.... UseModWiki소스수정/섹션단위수정
From:
이 자리에 JuanmaMPKr 페이지의 내용을 적은 후에 아래의 분류를 적절히 지정해주세요. 마땅한 분류가 없다면 그냥 기타분류로 놓아 두세요.
Welcome back, JuanmaMP. Glad to see you again! :-)
Would you please check your old pages and move (or delete, if you think okay) the contents of them to ONE page? Then I'll remove other pages.
Or, I could remove your account 'JuanmaMP' so that you can reset your password of it. Tell me if you want.
I removed other pages and all of user/juanma*.db files. You can make your account again now :-D
Done!. 효율성과 효과; have a good week.
Grateful.
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.
Doh!, it seems, you prefer don't use number ids, in file.
Hehe. Then, the above comment it's not relevant for your code.
Regards.
I deleted it. Now try making your account. :-)
Raymundo, really thank you :)
2012.05.30 축구: 스페인 - 한국 !!! :))
행운을 빌어요!
I saw those snapshots... Fantastic!!!!!!
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.
Q: at Sub DoRc:
print "
" . &ScriptLink("action=rc&from=$lastTs",
T('List new changes starting from'));
print " " . &TimeToText($lastTs) . "
\n";
it considers $lastTs even if it belongs from hidden page. Ins't it? Bug o feature about that?.
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.
Hi! Raymundo,
As far I Know, it works fine:
$lastTs = 0;
Only false if no lines in file
- if (@fullrc > 0) {
- ($lastTs) = split(/$FS3/, $fullrc[$#fullrc]);
- }
+ if (@fullrc > 0) {
+ my $i;
+ my $lastNs;
+ for ($i = $#fullrc; $i >=0 ; $i--) {
+ $lastNs = (split(/$FS3/, $fullrc[$i]))[1];
+ if (not &PageIsHidden($lastNs)) {
+ ($lastTs) = split(/$FS3/, $fullrc[$i]);
+ }
+ last if (not &PageIsHidden($lastNs));
+ }
+ }
Regards.
More polished. Good point. :)
Hi!,
Minor of Minor Tweak ($lastTs: it can be that it could not exist; for instance, all recent changes as hidden, for the being time).
- if (!&LoginUser()) {
+ if (!&LoginUser() && $lastTs) {
print "<br>" . &ScriptLink("action=rc&from=$lastTs",
T('List new changes starting from'));
print " " . &TimeToText($lastTs) . "<br>\n";
Regards.
}-- JuanmaMP 2012-7-11 3:26 am
You're right. But there's is other obstacle:
$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)
Hi Raymundo,
on sub GetGotoForm {
- ".value.replace(/\\s*\$/,).replace(' ','_');"
+ ".value.replace(/\\s*\$/,).replace('/ /g','_');"
If you insert in input[type=text]: "Something like this"
it yields: "Something_Like%20This"
once it changed it yields "Something_Like_This".
Thanks.
Thanks to you :)
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;
}
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";
...
In fact, the prune has sense when they are empty??.
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.
(종결/테스트 can be erased, thanks)
Hi Raymundo!,
a minor tweak, what about this snippet on 'PageIsHidden' instead of 'InitRequest'?
### hide pageBecause it is only useful when the action involves page but not for the remaining of them.
my ($status, $data) = &ReadFile($HiddenPageFile);
if ($status) {
%HiddenPage = split(/$FS1/, $data, -1);
}
I like the reasoning: "would be executed several times per one request".
(The exceptions are minor, the result is not efficient on stats).
Ok.
Hi,
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.
Hi,
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 ^_^.
Your suggestion is applied in "ext2.12": UseModWiki소스수정/이전수정본화면에서더블클릭
Hmmm, it's is really exciting become a foreigner just with fingers in a keyboard. :))
Anyway (now, more seriously), It's an honour participating here.
Thanks for implementing.
(Sorry, I forget my previous passwords, so I have scored this)