GetSimple Support Forum
php newbie help - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: php newbie help (/showthread.php?tid=1462)



php newbie help - h-sen - 2011-03-24

Hello everybody, I am a student from China, like GS!
Now, I want to use GS my personal studio to create a home page. Functions required homepage, project display, solutions, on the.
Projects in the production and solution pages, encounter problems!
As follows:
1, page function is to demonstrate the products produced by my studio, is there something similar?
2, GS Home News Manager provides extended I really like, what can support multiple directories?
3, whether by modifying an extension to support multiple installations?

My English is poor, this is Google machine translation, to bring you trouble, please forgive me!


php newbie help - yojoe - 2011-03-25

1. try simple image gallery (squareit) plugin
2. why do you need multiple directories for a news manager ?
You mean you want to provide more than one news column ?
3. you need multiple installaions of GS ?
Installation takes up to 30 seconds, and you're ready to manage.
There's no simpler way even using a plugin.
But some hosting companies offer GS as a one click installation application.

ps. if you have any problems with english, just ask your friends to translate between chineese, and english for you Wink


php newbie help - h-sen - 2011-03-28

是的,我的目的是用GS创建一个4月面的个人网站,需要2个页面做新闻列表。
Yes, my aim is to create a 4 months with GS the personal website, need 2 page and make news list.

类似News Manager这样的扩展,我需要安装2个到GS!
Similar News Manager such extension, I need to install 2 to GS!

up:Chinese
down:English


php newbie help - yojoe - 2011-03-29

If you need 2 different themes, then create 2 theme files in your own theme directory, and then you can set one of your created themes in page's options.

As it goes about multiple newses, try dominion's IT blog plugin
http://get-simple.info/extend/plugin/dominion-blognews/45/
But I cannot guarantee it will be working flawlessly with newly released GS3.0.


php newbie help - h-sen - 2011-03-30

3Q,i try it.


php newbie help - h-sen - 2011-04-03

A new problem:
dominion's IT blog plug-in is not supported on my server (% blog: baby%) is called. <? PHP xxxxxx;?> means there is no problem.
Server provider replied:
As (%%) are ASP syntax, due to security reasons, the server banned the use of ASP syntax.

How should I solve this problem?


php newbie help - Connie - 2011-04-03

this comes out as a general problem for all plugins which produce output in the content as the (% are used as "marker" for this output

I am not sure what to do, as this is a very rare case..

I think GetSimple cannot change that, can't you talk with your hoster's support?


php newbie help - h-sen - 2011-04-04

Connie Wrote:this comes out as a general problem for all plugins which produce output in the content as the (% are used as "marker" for this output

I am not sure what to do, as this is a very rare case..

I think GetSimple cannot change that, can't you talk with your hoster's support?
Oh!My God!


php newbie help - RobA - 2011-04-05

h-sen Wrote:
Connie Wrote:this comes out as a general problem for all plugins which produce output in the content as the (% are used as "marker" for this output

I am not sure what to do, as this is a very rare case..

I think GetSimple cannot change that, can't you talk with your hoster's support?
Oh!My God!

You can just edit the plugins to use a different pattern match syntax. Search for the (% .... %) and replace them with something else, say (== .... ==)

-Rob A>


php newbie help - Connie - 2011-04-05

RobA Wrote:You can just edit the plugins to use a different pattern match syntax. Search for the (% .... %) and replace them with something else, say (== .... ==)

-Rob A>

That is a good tip, but you will have to do this with every update of every plugin .. there is no general setting for that, and:

Code:
$tmpContent = preg_replace('/\(%(.*)googlemap(.*)%\)/i',$div,$tmpContent);


as you see, it is (%, but the closing tag is: %\) (I checked googlemaps- and extendedMP3-plugin)

I would never suggest to edit regular-expressions.... who will guarantee that it will work?


php newbie help - RobA - 2011-04-05

Connie Wrote:as you see, it is (%, but the closing tag is: %\) (I checked googlemaps- and extendedMP3-plugin)

I'm not a regexp guru but I think the "\" is just escaping the ")" in the regexp, so it really is searching for "%)"

It would be nice if these could be specified in a GSCONFIG setting...a GSPLUGINTAGSTART and GSPLUGINTAGEND tag that could just be set once in gsconfig.php and then used by plugin authors.

Though regexping wold be a bit tricker as it would require preg_quote.... so your example from a plugin could be:

Code:
$tmpContent = preg_replace('/'.preg_quote(GSPLUGINTAGSTART).'(.*)googlemap(.*)'.preg_quote(GSPLUGINTAGEND ).'/i',$div,$tmpContent);

-Rob A>


php newbie help - mvlcek - 2011-04-05

RobA Wrote:Though regexping wold be a bit tricker as it would require preg_quote.... so your example from a plugin could be:

Code:
$tmpContent = preg_replace('/'.preg_quote(GSPLUGINTAGSTART).'(.*)googlemap(.*)'.preg_quote(GSPLUGINTAGEND ).'/i',$div,$tmpContent);

-Rob A>

Not only that - the end tag might be legally embedded within the tag, thus it is nearly impossible to make the tags configurable e.g.
Code:
(% myplugin percentindicator="(%)" %)

BTW: the googlemap regular expression shown above is really bad and should rather be something like:

Code:
'/\(%(\s*)googlemap(.*?)\s*%\)/i'

otherwise it can not coexist with other similar plugins and match the following texts, too:

Code:
(% mybettergooglemap %)

Code:
(% googlemap %) some text (% searchform %) (% searchresults %)



php newbie help - h-sen - 2011-04-08

How should I solve my problem? You say I have not read! Thank you


php newbie help - mvlcek - 2011-05-04

h-sen Wrote:How should I solve my problem? You say I have not read! Thank you

Can you confirm that your provider filters the (% %) when you save the page (submitting the form)?

If this is the case, you can add the following lines to /admin/changedata.php (before the comment in line 104):
Code:
$content = str_replace('(=', '(%', $content);
$content = str_replace('=)', '%)', $content);

Then use (= =) in your page and save. Does it work?