[첫화면으로]JuanmaMP

마지막으로 [b]

Hi,

2007: 유감스러운, 나는 한국어 언어를 모른다

2004: 또한, 저는 Perl을 몰랐다

2012: (자, 두 언어를 조금 알고)

UseMod:JuanmaMP

Dear JuanmaMP

Welcome~ :-)
-- Raymundo 2007-6-8 9:36 am

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.
-- Raymundo 2007-8-11 9:46 pm

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
-- 80.58.205.41 2007-8-12 12:34 am

Things Done

  1. New own page in UseMod:UseModWiki Wiki: UseMod:UseModKr, based on http://gypark.pe.kr/cgi-bin/english/wiki.pl
  2. New Patch Footnote UseMod:WikiPatches/Footnote based on Local:UseModWiki소스수정/Footnote매크로
  3. New Patch DoubleClick UseMod:WikiPatches/DoubleClick based on core code: http://gypark.pe.kr/pub/gyparkwiki/wiki/wiki.txt
    1. It's valid for old versions too
  4. New Patch InterestingPages UseMod:WikiPatches/InterestingPages based on Local:UseModWiki소스수정/관심있는페이지

I hope it help to spread Local:UseModWiki소스수정 -- JuanmaMP

Thank you! :-)
-- Raymundo 2008-2-4 1:11 pm


개인페이지분류

이 자리에 JustSameJuanmaMP 페이지의 내용을 적은 후에 아래의 분류를 적절히 지정해주세요. 마땅한 분류가 없다면 그냥 기타분류로 놓아 두세요.

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.
-- Raymundo 2009-7-20 11:29 am

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) :)
-- JustSameJuanmaMP 2009-7-20 6:14 pm

I know it, of course~ :-D You are the only foreigner that comes here. How can I forget you?

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 ^_^.
-- Raymundo 2009-7-20 11:30 pm

Your suggestion is applied in "ext2.12": UseModWiki소스수정/이전수정본화면에서더블클릭
-- Raymundo 2009-7-20 11:47 pm

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)
-- JustSameJuanmaMP 2009-7-21 3:30 am



기타분류 내 한국어 능력에 대한 죄송합니다, 내가 여기서 멀리 떨어져 살아! :O

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.
-- Raymundo 2009-7-23 2:20 am

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;
+    }

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.
-- Raymundo 2012-4-1 11:49 pm

I removed other pages and all of user/juanma*.db files. You can make your account again now :-D
-- Raymundo 2012-4-2 9:34 am

Done!. 효율성과 효과; have a good week.
Grateful.
-- 83.38.76.90 2012-4-2 10:21 am

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.
-- JuanmaMP 2012-5-23 2:35 am

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.
-- JuanmaMP 2012-5-23 2:55 am

I deleted it. Now try making your account. :-)
-- Raymundo 2012-5-23 3:22 pm

Raymundo, really thank you :)
-- JuanmaMP 2012-5-24 2:40 am

2012.05.30 축구: 스페인 - 한국 !!! :))
-- JuanmaMP 2012-5-30 5:19 am

행운을 빌어요!
-- JuanmaMP 2012-5-30 5:21 am

Buena suerte para ti también! :-)
-- Raymundo 2012-5-30 8:12 am

I saw those snapshots... Fantastic!!!!!!
-- Raymundo 2012-6-5 9:15 am

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!.
-- JuanmaMP 2012-6-5 6:09 pm

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/
-- JuanmaMP 2012-6-6 5:36 pm

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.
-- JuanmaMP 2012-6-7 7:42 pm

Of course that didn't disturb at all. They were very very impressive and wonderful!

And "day and night CSS" is also a very fun idea. ^_^ Cheers!
-- Raymundo 2012-6-7 11:06 pm

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.
-- JuanmaMP 2012-7-9 12:45 pm

Oh, you're right. It's a bug. Thank you for finding it. I don't think it's critical, so I don't know when I fix it :-)
-- Raymundo 2012-7-9 3:13 pm

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.
-- JuanmaMP 2012-7-9 9:50 pm

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.
-- JuanmaMP 2012-7-10 3:09 am

Great! It's now applied. [diff in Github]
-- Raymundo 2012-7-10 2:03 pm

More polished. Good point. :)
-- JuanmaMP 2012-7-10 3:58 pm

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

However, in that case, lastTs would be one, not zero, because of

$lastTs++ if (($Now - $lastTs) > 5); # Skip last unless very recent

Am I wrong? (I didn't test myself)
-- Raymundo 2012-7-11 8:52 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.
-- JuanmaMP 2012-7-11 10:34 am

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.
-- Raymundo 2012-7-11 11:15 am

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?
-- JuanmaMP 2012-7-11 11:23 am

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)
-- JuanmaMP 2012-7-11 11:30 am

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.
-- JuanmaMP 2012-8-3 6:21 pm

Oh, thank you very much :-) I'll apply it now.
-- Raymundo 2012-8-5 2:46 pm

Thanks to you :)
-- JuanmaMP 2012-8-5 3:17 pm

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.
-- JuanmaMP 2012-8-8 2:26 pm

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"; ...
-- JuanmaMP 2012-8-12 12:06 pm

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.
-- Raymundo 2012-8-12 3:34 pm

In fact, the prune has sense when they are empty??.
-- JuanmaMP 2012-8-12 4:05 pm

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);
-- JuanmaMP 2013-2-16 11:29 pm

Hmm... does it matter? I think current version doesn't make any problem about it. Can you please show me any example?
-- Raymundo 2013-2-17 12:29 am

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)
-- JuanmaMP 2013-2-17 12:50 am

Thanks. :-)
-- Raymundo 2013-2-17 12:57 am

Hi Raymundo!,
a minor tweak, what about this snippet on 'PageIsHidden' instead of 'InitRequest'?
 ### hide page 
my ($status, $data) = &ReadFile($HiddenPageFile);
if ($status) {
%HiddenPage = split(/$FS1/, $data, -1);
}
Because it is only useful when the action involves page but not for the remaining of them.
See you, and thanks.
-- JuanmaMP 2013-3-29 3:15 am

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.
-- Raymundo 2013-3-29 3:30 am

I like the reasoning: "would be executed several times per one request".
(The exceptions are minor, the result is not efficient on stats).
Ok.
-- JuanmaMP 2013-3-29 6:27 am
이름:  
Homepage:
내용:
 

기타분류 Me too, in other wikis:

UseMod:JuanmaMP, Jof:JuanmaMP
감사.

마지막 편집일: 2024-9-1 10:20 pm (변경사항 [d])
2866 hits | Permalink | 변경내역 보기 [h] | 페이지 소스 보기