TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Toolbar (http://www.talkphp.com/general/1338-toolbar.html)

Jmz 10-25-2007 08:54 AM

Toolbar
 
I'm having a play around making a simple cms and I was wondering, how do you do the toolbar things (like the one above the text area when making a post for example).

Do people make their own? I've seen some ready made open source ones, are they any good?

CMellor 10-25-2007 11:28 AM

Do you mean a WYSIWYG?

I use this: http://tinymce.moxiecode.com/ it's very good.

Jmz 10-25-2007 11:50 AM

Yea, thats what I mean.

Is the one you suggested easy to implement? or is it more advanced?

CMellor 10-25-2007 10:25 PM

Really easy to install. Follow the instructions on there website's Wiki page, it will help a lot.

Andrew 10-25-2007 11:36 PM

TinyMCE is definitely the best, and easiest to install. It's the one Wordpress and other scripts use in the backend.

Jmz 10-26-2007 08:04 AM

I must admit, I'm really pleased with this toolbar, got the whole thing up and working in a few minutes :D

Thanks a lot!

Jmz 10-26-2007 09:12 AM

I've came across a weird bug with this, its been mentioned on their forum but there's not a fix so I thought I'd post here to see if anybody else has came across it.

Basically if you go to: http://jamesowers.co.uk/cms/add.php in ie you will see the content box doesn't work but if you go to: http://www.jamesowers.co.uk/cms/add.php it works fine. Does anybody know what would make this happen? The javascript error is 'access denied'.

bluesaga 10-26-2007 10:15 AM

Probably slack coders on there front, if its a known bug and they haven't fixed it there probably isn't much support for it.

Is this the one wordpress uses?

Jmz 10-26-2007 12:01 PM

Yes I think it is.


Is there a way (using php or something) I can check if the url has the www in and if it doesnt then redirect them to a page that does?

Wildhoney 10-26-2007 01:50 PM

In .htaccess you can:

Code:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^jamesowers.co.uk
RewriteRule (.*) http://www.jamesowers.co.uk/$1 [R=301,L]


bluesaga 10-26-2007 02:44 PM

Also possible in PHP:

PHP Code:

if(substr($_SERVER['SERVER_NAME'], 03) != 'www')
      
redirect301('http://www.' $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);

function 
redirect301($szLoc
{    
      
header('HTTP/1.1 301 Moved Permanently');
      
header('Location: ' $szLoc);
      exit;


This will redirect any url that doesn't have www at the very beginning to www version of the url

Jmz 10-26-2007 03:18 PM

Quote:

Originally Posted by bluesaga (Post 3381)
Also possible in PHP:

PHP Code:

if(substr($_SERVER['SERVER_NAME'], 03) != 'www')
      
redirect301('http://www.' $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);

function 
redirect301($szLoc
{    
      
header('HTTP/1.1 301 Moved Permanently');
      
header('Location: ' $szLoc);
      exit;


This will redirect any url that doesn't have www at the very beginning to www version of the url

Doesnt seem to be working :confused:

http://jamesowers.co.uk/cms/add.php

Andrew 10-26-2007 10:19 PM

I'd use the .htaccess one for the main reason is that you need to put that PHP code in every file that you want to switch to www. The code Wildhoney works on all pages on a site.

bluesaga 10-26-2007 10:22 PM

I would do what Andrew suggests also, however if you have added the code to the start of "add.php" then it should be fine....

You need to ensure there is no whitespace in the output html before the code also, as this will cause it not to redirect properly.


All times are GMT. The time now is 03:37 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0