These Question/Answer pairs may be moved to the FAQ page.
This page is for Question/Answer pairs. If you want to post a question, please use the Questions page.
In the future it would be possible to see some plug-ins that will export a wiki document in a different format, like: man pages, pdf, latex, simple html.
Yes it's possible. Check the Cookbook:HomePage. If you're a coder, maybe you can develop the plug-in.
Why when writing PmWiki did you decide to put much of the code, if not all, in pmwiki.php
?
Yes -- I get headaches understanding the code too.
Take it slowly. First, there are a LOT of modules under scripts/ that are probably the keys to whatever you are looking for. I don't read the code from pmwiki.php
out. I suggest that if you want to analyze edit functionality, then find the module that supports that function. Then filesystem text searching through the code (recursive greps with line numbers) can be the key to find function definitions.
In the Cookbook modules I (XES?) wrote, I was careful to comment the code. It took me a while but by analyzing the rss.php
module to make my Cookbook:RssImproved module, I have caught on to a lot of the code habits in the main body. It took a lot of cursing PM out, pacing, and banging my head -- but I did it.
Major headache:
SDV($variable,"value");
-- Set Default Value (or that's how I think of it) -- PmWiki allows setting nearly every variable from config.php
. So before PmWiki or it's modules can set a value, they have to check whether it was already set. This function checks if a variable is set -- if not, it applies the value to it.
I had to find where that was defined to figure it out. Painful :)
Watch out for important variables with nonsense names like $t or $u for something like a timestamp or uptime (and consider it luck if the initial variable matches what it stands for). I do a careful global search&replace on them when I figure out what they are -- this way the rest of the code becomes so much easier to read.
I think PM codes much faster than he can comment
Is there a statistic tool for PmWiki
What type of statistics are you referring to?
Most website statistics software should work, but is independent of PmWiki.
If you know what you want, though, it might be easy to "cook up".
One existing solution is the Cookbook:Simple Page Counter, another is Cookbook:Total Counter, many people with public websites use Cookbook:Google Analytics
2) I cannot tell which statistics the author referred to, but I can tell that I would like a tool that would
- enable me to see how many pages there are within groups,
- how many pages there are all in all,
- how many pages were created within the last X hours/days,
- how many unique IPs were using the page within a time period, and those sort of things.
I am certain that a lot of these are already built in to the system, but with my non-existant PHP abilities I have not been able to find them.
Is there a sectioning plugin which makes it possible to segment a page into several sections with their own edit button?
You might find Cookbook:Include With Edit interesting... surely you'd have to create the included pieces yourself but at least you get an automated "edit" link --Uli?
I've had a load of spam links appear on the Edit page on my wiki
I realise I need to fix the passwords, I'm in the process of doing that.
They're here: http://www.petty.me.uk/pmwiki/pmwiki.php?n=PmWiki/EditQuickReference. Scroll down on that page to see them. Use history and restore. -- TeganDowling?
Thank you Tegan, that's fixed it. I didn't know the Quick Reference was a wiki page (but it's obvious now!). The moral of the story is - set an admin password as soon as you can. Secure your pages first, then open them up bit by bit. -- MatthewPetty?
You're very welcome - that Edit Quick Reference page is kind of neat (note that there have been some changes to it, here on PmWiki, recently). BUT I think the moral of the story is that you should be going to your Main.AllRecentChanges every single time you log on (if not even more often). It's your site, and you should know everything that happens on it. -- TeganDowling?
See also Security.
How does my PmWiki site get logged by the search engines, can they see the content within? I noticed that google has seemed to lose my site in the search findings ever since I went from HTML to a PmWiki site. What can I do to get back my rankings?
A: Normally PmWiki pages are scanned by search engines -- same as any other pages. As an example, do a search for "PmWiki" and see just how many PmWiki pages have been indexed by Google. Also, don't forget that Google's re-indexing isn't instantaneous -- it may take several weeks before the Googlebot gets around to re-indexing your site and finding the new content at its new location. (Also, make sure you don't have a robots.txt file that is turning the search engines away.) --Pm
How to markup external links like Wikipedia does?
It would be nice for some applications (at least mine ;-)) to show READERS (unfortunately the majority in most Wiki-installations): this link is an external one. Similar as the question mark shows empty internal links. Maybe, there's already a function implemented. If not, I can try to write such a markup with my limited PHP 4 experiences. --Armin
Its better to do it in the "Wiki way". Define your own $UrlLinkFmt
like the follow in the local/config.php. Then every external link gets an icon and the Window opens in a new one.
$UrlLinkFmt = " <a class='urllink' target='_blank' title='\$LinkUrl' rel='nofollow' href='\$LinkUrl'>\$LinkText <img src='$PubDirUrl/external.png' alt='External Link to \$LinkUrl' title='External Link to \$LinkUrl' border='0' /></a>";
put your wanted external link-icon in the
Directory as $PubDirUrl
external.png
.
(don't know exactly if its possible to do this with css. there may be the best place. i think its possible but i'm not familiar with css.) newmy?
Armin, how did you manage to get the Google adwork running on a wiki page. I tried that before but don't know where to add the Google code. Thanks, Oliver
I guess, I've added the Google Adsense lines to the .tmpl file, for the skin I'm using. Have to check source code at home.Armin?
My wiki has been up and running for a month now. I'm really happy with it. Except I have a problem with search engines, Google in particular. It's not indexing it.
Keep in mind that Google sometimes takes a month or more before it will crawl a site. If you can check your site's access logs, see if you've been visited by the GoogleBot at all. Even after GoogleBot visits, it may be a couple of weeks before Google updates its indexes on its public sites.
How can I change the name of the months when using $[$CurrentTime], because my page is in Portuguese and it is displaying the month in English. What can I do?
Have you looked at the portuguese translation? files yet? See also PmWiki.Internationalizations.
C:yes I have seen it all and even the PmWikiPtBr page displays the months in English.
Final A: I have just changed the locale value on the XLPage from pt to pt_BR and $[$CurrentTime] displays the months in Brazilian Portuguese. :) Carlos AlbertoBonamigo
I have done the same in the Catalan page, but it still shows the months in English. I've seen it correctly displayed in the Catalan language pages of this site, so wtf?
I love PmWiki and am using it for an English and Japanese bilingual site. I want to keep the function labels in English but edit in both languages.
config.php
to use the Shift_JIS character set. Editing is working fine in Japanese but I can't get the double bracket function to create Japanese page titles. They show up as gibberish on the edit page. Any ideas?
Hi, we need to collaborate, I'm doing the same thing, using Japanese and English, only I'm trying to enable UTF-8 on my site. It's more up to date than Shift_Jis from what I've read.
Fancy that, I'm working on a Japanese site too! It's not ready yet, but UTF-8 support seems to be the ideal (and the only) solution for Japanese in pmwiki.
Bonjour I am working on english, french, chinese and japanese one... What I need is; when reader clic on chinese or french a corresponding blanc page appear if there is nothing or the corresponding translation already made. Like I was cliquing on chinese of this page it would be an internationalise chinese blank page appearing if nothing was translate.
Is there a way to change the character encoding to UTF-8?
Download the internationalizations code, then add the line include_once('scripts/xlpage-utf-8.php');
to your local/config.php
. This enables utf-8 on the site.
I have just recently upgraded my php version to 5.0.2 and now the wiki is broken with error message: Fatal error: Call to undefined function preg_replace()
in /usr/home/tomtux/public_html/pmwiki/pmwiki.php
on line 82.
preg_replace()
is one of those "basic" functions that is supposed to be available in every version of PHP. It's totally bizarre that your 5.0.2 doesn't have it -- do you have any details of how PHP was upgraded...? Contact pmichaud@pobox.com for more assistance on this one... --Pm?
I had figured it out after doing more research, since the box was freebsd and by default when you install php from the port section it does not include php-extensions, so once I installed php-extension package from the freebsd ports, it is working now. --tomtux
Are you planning adding something like a captcha to prevent bots from spamming non-password protected wiki sites?
--Michael
Actually, adding "UrlApprovals" seems to have largely resolved the spamming problem, at least on pmwiki.org. The next step for PmWiki will be to add user-based authorization capabilities (PITS:00010), and then if we still need it we might look into a captcha-like system. But this would add slightly to PmWiki's base system requirements and I'd prefer to avoid that. --Pm?
Why utf-8 is not used for all pages. I really liked the idea of mulltilanguage without changing the group.name or opening a new group.name .
Maybe it is somehow connected to the issue I've described below (at the bottom of this page)? --CleverFool
The basic issue is that regular expression support for utf-8 is still not completely available in PHP. See PITS:00168. --Pm
See also UTF8.UTF8?. --Pm
How can I display a html file from the same folder that pmwiki is installed , inside (i.e.) a PmWiki.HomePage wiki page file?
By default this isn't supported, because it poses a few security risks. But a cookbook recipe could be developed to support it. (See Cookbook:IncludeUrl for one example.) (and also the included markup.)
Is there a PmWiki-Forum, where I can ask questions like this: Is there a list of WebHosts about successful PmWiki-Installations? My experience with different WebHosts: 90 % of PmWiki installations failed!
I've to admit: all these installations failed due to no PHP support from webhost. If your car needs gas, you can't drive without it!
Let's just create one at WebHosts. And I'm very interested to know which installations failed and why. --Pm
C: O.k. I'll be there in more detail. But the major issue I can already disclose here: permission setting problems caused failed installations. --Armin
I have used one of the recent pmwiki 1 versions to create russian-language wiki site.
--CleverFool
PmWiki 2 urlencodes its links (even PmWiki 1 is doing this to some extent). And also take a look at UTF8.UTF8? to see what's being done with utf8 characters in link names. --Pm?
I understand that PmWiki is designed for fast edit and fast saves; my question is: what about *rendering*?
Well, PmWiki comes with a complete set of documentation when you install it, so this would give you some idea of its rendering speed. And really the choice of saving the markup (ASCII) data in flat files versus SQL isn't a major speed differentiator (see FlatFileAdvantages)-- the real question is how quickly the engine can convert the markup text into HTML, and if the rendered text can be preprocessed or otherwise cached so that it doesn't have to be reprocessed at each page access. At present PmWiki doesn't do much in the way of caching or preprocessing rendered output (although we're working on it), but PmWiki is still reasonably quick given all that it does. Pm has placed timers in the code to evaluate it, and so far all page renderings observed, even for complex pages such as PITS:PITS, use less than 0.75 seconds of user-space CPU time, with most pages being processed in 0.25 seconds or less. --Pm?
FlatFileAdvantages indeed convinced me ;-) Thanks, too, for the very quick reaction -- Hervé
Why not to document programming API's? and all those fancy calls like PZZ()? and SDV()?? This would help building extensions a much!
--mikei?
It's simply a matter of available time -- writing documentation takes a long time. I need to finish writing the basic PmWiki documentation first (see PITS:00122) and then I can work on documenting PmWiki's APIs. --Pm?
PmWiki is cool and easy. But how can i achieve that when i upload a file, the Attach:xy.file Δ Link is automatically created in the page i am Uploading to ? --Adrian?
Try this solution: it uses the Cookbook:Attachtable recipe which you will need to install. Then add the directive (:attachtable ext-'doc,odt' data=none actions=none:)
to your page, it will show files uploaded. PS I recommend that you also use the per page upload directories --simon?
Category: Questions
This page may have a more recent version on pmwiki.org: PmWiki:FAQCandidate, and a talk page: PmWiki:FAQCandidate-Talk.