Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Finaly, texy! for snews  (Read 7851 times)

Palmik

  • Jr. Member
  • **
  • Karma: 2
  • Posts: 58
    • Palmik's Page
Finaly, texy! for snews
« on: March 22, 2008, 11:39:54 am »

Long time ago I had a dream - texy in snews, and now it looks that my dream beceme a real. (If only I had know that it will be so easy)
Skip this part and go in to the instaltion

1. Dowlonad Texy! here (it is Texy2 beta)
2. Open your index.php and change following
Code: [Select]
<?php session_start(); include('snewsMU.php')?>with
Code: [Select]
<?php session_start(); include('snewsMU.php'); include_once('texy/texy.php');?>3. Open your sNews(MU).php and find
Code: [Select]
file_include (str_replace ('[break]','', $text), $shorten);replace it with
Code: [Select]
    $texy = new Texy();
    $texytext = $texy->process($text);
    file_include (str_replace ('[break]','', $texytext), $shorten);
4. Look at the Texy! syntax here, it is very nice and sexy :D http://texy.info/en/syntax
5. Was not it easy? :) Only thing to finish it is to find place where are comments parsed and add it here too. :)


« Last Edit: March 22, 2008, 11:43:55 am by Palmik »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Finaly, texy! for snews
« Reply #1 on: March 22, 2008, 03:08:47 pm »

Hmmm... you've got me interested... will have to try this out right away (almost).  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Finaly, texy! for snews
« Reply #2 on: March 22, 2008, 04:44:45 pm »

@ Palmik... what's the 'secret' to making it work? I can't see anything - sNews textarea is still the default one. Maybe I am missing something... there are no install instructions... what do I put in the sNews root to make it work?
I am testing this in a default sNews 1.6 project (no MU). So far... I...
- copied the texy folder into the sNews root,
- did your step 2, and step 3
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

jared351

  • Sr. Member
  • ****
  • Karma: 4
  • Posts: 276
Re: Finaly, texy! for snews
« Reply #3 on: March 22, 2008, 06:53:39 pm »

You probably did everything right Keys, so now you can use the Texy syntax. You can read more about the syntax http://texy.info/en/syntax <-- there. For example, when you type in something like this in the textarea:

Code: [Select]
Lorem ipsum dolor sit amet,
still the same paragraph.

Second paragraph

It should go to something like this for the output:

Code: [Select]
<p>Lorem ipsum dolor sit amet, still the same paragraph.</p>

<p>Second paragraph</p>

Correct me if I'm wrong please.
Logged

Joost

  • Guest
Re: Finaly, texy! for snews
« Reply #4 on: March 22, 2008, 07:25:02 pm »

How does it cope with [break] ?
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Finaly, texy! for snews
« Reply #5 on: March 22, 2008, 07:33:29 pm »

This is great Palmik. It needs a little effort to learn the syntax but is worthy. I think I will make a package with this only for me :D

I looked into syntax and not saw any conflict. But I think the problem is when is surrounded by p tags.... here come in place the Read more mod (read more inside article) I think...
Logged

Palmik

  • Jr. Member
  • **
  • Karma: 2
  • Posts: 58
    • Palmik's Page
Re: Finaly, texy! for snews
« Reply #6 on: March 22, 2008, 07:38:12 pm »

How does it cope with [break] ?
Perfectly I think. I did not find any problem, and one big plus is that you must not "convert" old articles.

@ Keyrocks
By the link I had provided to you you will download directory with name "texy-2.0-beta2"... I uploaded directory with name "texy" to my root.

@ ared351
This is the last thing, you can handle links, paragraphs, headings, tables and many more...
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Finaly, texy! for snews
« Reply #7 on: March 22, 2008, 09:57:10 pm »

You probably did everything right Keys, so now you can use the Texy syntax. You can read more about the syntax http://texy.info/en/syntax <-- there.
Correct me if I'm wrong please.

Right you are. I was expecting to see a "new" textarea panel. So it's invisible... 3 lines separated by a line-space and using no tag-wrappers... displays as 3 separate paragraphs. Hmmm... very convenient thus far. Must now figure out how the syntax sensing works.
Question... does this mean we could actually do away with the default tag generator buttons altogether? Perhaps we'll learn the answer as we go.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Palmik

  • Jr. Member
  • **
  • Karma: 2
  • Posts: 58
    • Palmik's Page
Re: Finaly, texy! for snews
« Reply #8 on: March 22, 2008, 10:03:26 pm »

Yes, default tags are with this mod gimcrack. Benefits from this mod are, that the text taged with texy! syntax is clearly readeable and it does not require any html skills, so it would be nice to implement it for the comments too, but find place where comments are being parsed would be (at least for me) the hardest thing.
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Finaly, texy! for snews
« Reply #9 on: March 22, 2008, 10:28:27 pm »

Palmik, this editor is great for admin but why you want to let people to insert in comments links and images?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Finaly, texy! for snews
« Reply #10 on: March 22, 2008, 10:44:18 pm »

Palmik... Thanks for sharing the Texy addon with us. I ran through all of the syntax examples from the Texy site.
My Impression... It's pretty decent for anyone that doesn't mind learning the syntax bits that need to be inserted. I noticed that not all syntax works with others... such as inserting a block of code in between 2 horizontal lines... and using the blockquote syntax between 2 horizontal lines... as examples that I could not get to work. I tried several variations of spacing... no luck.

While it's true that the user doesn't need to use any HTML... the user still needs to have a reference for the Texy syntax insertions... another language form that isn't so convenient for the non-techie user.

The user doesn't need to understand HTML to use the tag generator buttons that come in the default sNews editor... just needs to know how to highlight the text and click the button. Same with the custom icon-based tag generator buttons that come with the Admin Panels in the MESU and MEMU packages... additional functionality using the existing sNews tag generator function.

If I were going to add another editor to an sNews project... I would rather use a WYSIWYG addon... like TinyMCE for example. My clients would find it more convenient to use than Texy. That's just my own impression... giving it a try was interesting tho.   :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Nicu Alecu

  • Full Member
  • ***
  • Karma: 12
  • Posts: 224
    • BLUEBYTE.ro // IT consultant
Re: Finaly, texy! for snews
« Reply #11 on: March 23, 2008, 12:06:18 am »

Agreed, Keyrocks! I ran into texy about 6 month ago (about the same time I ran into sNews) and really liked it ... but that's just me! none of my non-html-ed clients ever thought of "learning" some "editing syntax", when presented with both options: texy & tinymce. I even presented a third option, fckeditor, which is more powerfull and complete that tinymce, but no luck on fck either. Almost everybody went the tinymce way, due to it's simplicity and easy learning curve.
Logged

Palmik

  • Jr. Member
  • **
  • Karma: 2
  • Posts: 58
    • Palmik's Page
Re: Finaly, texy! for snews
« Reply #12 on: March 23, 2008, 12:37:02 pm »

Yeah, maybe, but there are also mods for texy!, like Texyla (texy! editor, where you can see what you get... pali was talking about it some time ago).
For me is Texy! good for one reason and it is readability of long texts.

Code: [Select]
Header
======
- list
- list
- **bold list**
- "text of the link":http://url.something
- x^2 + y^3

vs

Code: [Select]
<h2>header</h2>
<ul>
<li>list</li>
<li><strong>bold list</strong></li>
<li><a href="http://url.something">texyt of the link</a></li>
<li>x<sup>2</sup> + y<sup>3</sup></li>
</ul>

Maybe differece is not clearly visible, but if you are writing quite long texts it is visible
Logged

Palmik

  • Jr. Member
  • **
  • Karma: 2
  • Posts: 58
    • Palmik's Page
Re: Finaly, Texy and Texyla
« Reply #13 on: March 23, 2008, 05:27:07 pm »

Hi, so I tryed to apply Texyla (texy! editor)on sNews and it works... :)
So, here is an tutorial :)

1. Download Texyla! here and upload it to your root (upload only directory texyla and futher)
2. to your index.php add line
Code: [Select]
<script type="text/javascript" src="texyla/texyla.js"></script>3. In your sNews(MU).php find
Code: [Select]
echo html_input('textarea', 'text', 'txt', $frm_text, l('text'), '', '', '', '', '', '2', '100', '', '', ''); and after this add
Code: [Select]
    echo '<script language="JavaScript">';
    echo 'new Texyla(Texyla.configurator.admin(\'txt\'));';
    echo '</script>';

I had been talking about Texyla in sNews with pali, but his version was not working correctly so I made my own one.

But, there is one bug (I thing its buggy because of collapsing sNews with texy) - you can put [break] after lists, italics or bold, because rest of page would be list, bold or italic. May be it is because of this part of code
Code: [Select]
    $texy = new Texy();
    $texytext = $texy->process($text);
    file_include (str_replace ('[break]','', $texytext), $shorten);
Maybe there is better place to past text through texy!

Edit: Of course you can delete, or comment out this lines
Code: [Select]
echo '<p>';
echo html_input('button', 'strong', '', 'B', '', 'button', 'onclick="tag(\'strong\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'em', '', 'I', '', 'button', 'onclick="tag(\'em\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'strike', '', 'Strike', '', 'button', 'onclick="tag(\'strike\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'p', '', 'P', '', 'button', 'onclick="tag(\'p\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'br', '', 'BR', '', 'button', 'onclick="tag(\'br\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'sp', '', 'SPAN', '', 'button', 'onclick="tag(\'span\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'break', '', 'Break', '', 'button', 'onclick="tag(\'break\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'img', '', 'Image', '', 'button', 'onclick="tag(\'img\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'link', '', 'Link', '', 'button', 'onclick="tag(\'link\')"', '', '', '', '', '', '', '', '');
echo html_input('button', 'include', '', 'Include', '', 'button', 'onclick="tag(\'include\')"', '', '', '', '', '', '', '', '');
echo '</p>';
« Last Edit: March 23, 2008, 05:31:53 pm by Palmik »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Finaly, texy! for snews
« Reply #14 on: March 23, 2008, 06:28:44 pm »

Do you know if there is an english language version of the source site?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: [1] 2