Mediawiki - Using PHP inside a form or page - php

I need to use some PHP code inside of a MediaWiki form. Basically, I need to use some PHP date stuff and create a few infoboxes based on timeframes. Is there a way to use PHP to generate a "template" in the "edit" box?
I'm very new to developing with MediaWiki, so I'm not sure how MediaWiki exactly works, and this is a very small project, so I haven't really dived into any documentation for the most part.

You can certainly add secure HTML within a wiki page. It seems there is also a securePHP extension. I haven't tried the PHP one myself but the HTML one works very well.

I was able to do this myself with a MediaWiki plugin called SemanticForms:
SemanticForms

Related

PHP Form builder class working with old version of bootstrap?

I am using the php form builder class (http://www.imavex.com/pfbc3.x-php5/examples/html5.php)
and jqbootstrapvalidation (http://reactiveraven.github.io/jqBootstrapValidation/)
So far I can succesfully combine these (even using some of the patterns php form builder class already built in) and I edited some of the element php files to change a pattern here and there, and to add some \n's to make a readable source code. (I still don't like my entire form on a single line in the source..)
But I would like to use different colours for the bootstrap. I've tried downloading several themed bootstrap.min.css files using paintstrapand twitter bootstrap themeroller
However, as soon as I include these instead of the standard netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css file, all my styling is lost and it looks the same as if there was no stylesheet included.
Since the php form builder class is relatively old, do I need to change all it's code to become compatible with the newer bootstrap, or is there a faster way to do this (perhaps a different form builder?)? Or am I messing up something else that is causing this change style options?
Appearantly there are a few changes need to make to fix this:
https://code.google.com/p/php-form-builder-class/issues/detail?id=205
allthough it is not "full-on" bootstrap 3.0. Also, the jqueryvalidator needs some adaptation to work with bootstrap 3.0. I'm currently busy making everything work the way I like it, adding glyphicons for the forms (optionally) etcetera. I'll get back to you as soon as I am finished and drop the code of somewhere for all the lovely people to enjoy or shout at.
I did'nt want to use imavex class for several reasons :
wanted a class witch could be easily updated if Bootstrap's version changed
wanted to have more control on generated code (add or remove wrappers, class, attributes, ...)
wanted to generate separate code for css/js includes/js code
wanted to be able to configure any jquery plugin with it
So I made my own (not free but only 5$), you can see the demo and complete doc here : http://codecanyon.net/item/php-form-class-for-bootstrap/8790160?WT.ac=category_thumb&WT.z_author=migli
Hope it helps and hope you'll like it

conflicting functions when using two includes (mybb and wordpress)

I use MyBB for forum and Wordpress for blog. When I try to integrate both together into a page, I get conflicts between functions. The forum header and the wordpress includes have some functions with the same identifier.
I need both functions but I obviously can't change the name of something inside wordpress or mybb.
What are the solutions to these conflicting problems?
Can I deinclude an included file?
If I could use iframe then it wouldn't look good with the scrolls and the border. If this is the only way then how can I remove the border and the scrollbars so that it would look exactly the same when the code was in the original page itself?
First of all: That is a hell of a task.
Still thou, if you aim to do it, read up on namespaces.
I figure it is possible to add those to all wordpress classes and all myBB classes.
You would have to do a lot of rewriting, but some search and replace tools using regular expressions should be able to help you with that.
You could also try to havew them seperately (yourdomain.com/myBB and yourdomain.com/wp) and integrate them via webservices. So you myBB would access wordpress data via RSS?

How to copy a complete php/mysql website with php?

I have a typo3 website with no user genrated or dynamic content.
So it is unnecessary to use php and the database.
Is it possible (with php) to clone the hole website and store every page as an html page?
I have only a normal webspace, so i cant install tools like "eAccelerator".
My idea:
- grab every link from the sitemap
- file_get_contents -> store as html
But i think this is not a clean solution? Or?
Thanks in advance!
james
you can use a simple software called HTTRACK., here is the link:
httrack.com
Why you need to use php to copy it? Did you consider using a command line tool like wget? wget allows you to create an "offline" copy of a website which you can of course host somewhere else. Sounds to me exactly like the thing you want to do.
In case you are really stucked to php, you will need an HttpRequest, call the site, parse all links and resources, download the resources, follow the links and do the same again. This is the most simple solution, without any checking for conflicting resources or other stuff which could go wrong.
Sitesucker http://sitesucker.us is an excellent tool you can run from any mac. It works very well, I use it all the time.
But don't forget that by creating a static copy of your site, you will lose your templating functionality. So if you really want to make your website static, I strongly recommend to - at least - put the identical parts of each page into php-includes. Mostly head, page header, footer, navigation. So you're ready for future changes.
If it's just because your TYPO3 is too slow, look at the nc_staticfilecache extension which can speed it up very well.
Using TYPO3 where you need just a simple HTML is a huge overflow, invest in DreamWeaver and code all things 'manually'.

Do I need to know php and mySQL to convert static website to wordpress theme

I have created a static website using xhtml, css and jquery. I have got zero knowledge or understanding of how php and mySQL works. Is it possible to create fully functional theme for wordpress? And how about using frameworks?
You'll be able to do it but you'd need some basic at least PHP knowledge to get going.
Start out having a look at the Wordpress Codex - http://codex.wordpress.org/Main_Page.
It's full of all the information you'll need to get started.
From there have a look at an existing Wordpress theme. Try making small changes to that and see how you get on.
You won't really need MYSQL as Wordpress runs it's own, easy to understand querys.
Good luck.
Anything's possible with enough time.
At the very least you will need to learn PHP, but you can do this by downloading an existing theme and modifying it to suit your desired HTML output.

PHP include one website into another

I'm trying to show my Dropbox Public Folder on my website, i've got the link and i'm trying to use PHP include to do it like this:
<?php
include("MY DROPBOX LINK");
?>
But nothing shows up. I'm trying to avoid iFrames and thought PHP might be cleaner
include only works with local file references (same server)*- what are you specifically after? You could use an iframe?
<iframe src='MY DROPBOX LINK'></iframe>
OR
To include in your application, there are also native PHP scripting means such as here..and also here
*correction: as per the comments below, you can grab external content, though it is not recommended
You should probably be looking at using the Dropbox API for this. There is some PHP code here which should be a good starting point.
If you can install the php-curl module (or already have it), that seems the best option to me without iframes.

Categories