Stringek darabolása, előkészítése css formázáshoz

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
Snippet
Stringek darabolása, előkészítése css formázáshoz

Ahogy a képen is látszik, az ilyen szövegek formázása nem túl egyszerű. Bármikor jól jöhet, hogyha egy címnél például az első 3 karakternek más-más háttér kell, vagy egyéb hasonlóan cudar manővereket pakolt a grafikába a designer.

Ez a kis sminkfüggvény egy modulba, vagy a template.php-be megkönnyíti a munkát, feldarabolja, classolja a létrehozott spanokat, így már lehet célozni css-ben.

Használata, ha mondjuk egy block címét akarjuk felspanolni, akkor a block.tpl.php-ba cseréljük le:

[geshifilter-code]<h2 class="title"><?php print $title; ?></h2>[/geshifilter-code]

erre:

[geshifilter-code]<h2 class="title"><?php if ($title != '<none>') : print theme_fragmented_string($title, $ide_amilyen_class_nevet_akarsz_a_spanoknak, TRUE); endif; //a végén a TRUE akkor kell, ha sorszámozni szeretnéd a class-okat?></h2>[/geshifilter-code]

És ilyen html-t kapunk:

[geshifilter-code]<h2 class="title"><span class="fragmented fragmented-1 fragmented-1">1</span><span class="fragmented fragmented-2 fragmented-0">0</span><span class="fragmented fragmented-3 fragmented-8">8</span></h2>[/geshifilter-code]

És a sminkfüggvény, csak másold be a template.php-ba:

[geshifilter-drupal6] /* * Theme function to separate string into different <span>'s * * @param $string * The string need to divide * @param $class * The class name in <span class="$class"> * @param $count * If TRUE, in <span class "$class"> will be one more class with counter. * @return * The separeted string. */ function theme_fragmented_string($string, $class = 'fragmented', $count = FALSE) { $output = ''; $string_array = preg_split('//u', $string, -1, PREG_SPLIT_NO_EMPTY); $counter = 1; $classes = $class; foreach ($string_array as $key => $value) { if ($count) { $classes .= ' ' . $classes . '-' . $counter; } $classes .= ' fragmented-' . $value; $output .= '<span class="' . $classes .'">' . $value . '</span>'; $counter++; $classes = $class; } return $output; } [/geshifilter-drupal6]

És végül köszönet Sweetchucknak, aki segített a preg_splitet összehozni.

Ja, és azért értelemszerűen 100+ karakteres szövegre nem biztos, hogy ezt kell használni.

Hozzászólások

Thank you for some other

Thank you for some other informative web site. The place else could I get that kind of information written in such an ideal means? I've a undertaking that I am simply now working on, and I have been on the look out for such information.|

I actually have been browsing

I actually have been browsing online greater than 3 hours lately, yet I
never discovered any fascinating article like yours. It is actually pretty price
sufficient in my opinion. Inside my view, if all site owners and bloggers made excellent content as it is likely you did,
the web could be a lot more helpful than previously.

The other day, while I was at

The other day, while I was at work, my sister stole my iphone and tested to see if it can survive a 25 foot drop,
just so she can be a youtube sensation. My apple ipad
is now destroyed and she has 83 views. I know this is completely
off topic but I had to share it with someone!

http://westchesterny.org/__me

Hello, I enjoy reading

Hello, I enjoy reading through your article post.
I wanted to write a little comment to support you.

Thanks for sharing such a

Thanks for sharing such a pleasant opinion, article is pleasant,
thats why i have read it completely

Your mode of describing

Your mode of describing everything in this paragraph is
really nice, all be capable of without difficulty know it, Thanks a lot.

Wow, marvelous weblоg

Wow, marvelous weblоg structure! Howw long have you ever
been blogging for? you made blogginng look easy.
The total glance of your site isѕ wonderful, as neatly as the content! https://brimur1ee2.gitbook.io/edwinhnud538/kenapa-daftar-agen-bola-sbobe...

Great article! We will be

Great article! We will be linking to this particularly great article on our website.
Keep up the good writing.

Hi there, yes this article is

Hi there, yes this article is genuinely nice and I have learned lot of things from it concerning blogging.

thanks.

Thank you for sharing your

Thank you for sharing your thoughts. I truly appreciate your efforts and I will be waiting for your next write ups thank you once again.|

Wonderful blog! I found it

Wonderful blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo News?
I've been trying for a while but I never seem
to get there! Appreciate it

Fantastic beat ! I wish to

Fantastic beat ! I wish to apprentice even as you amend your website, how could
i subscribe for the blog website? The account aided us a applicable deal.
I have been tiny bit acquainted of this your broadcast offered vivid transparent concept

http://aiminvestment.biz/__me

Very good blog you have here

Very good blog you have here but I was curious if you knew of any message boards that cover the same topics discussed here? I'd really love to be a part of community where I can get feedback from other knowledgeable individuals that share the same interest. If you have any suggestions, please let me know. Kudos!|

I visited many web pages but

I visited many web pages but the audio feature for audio
songs present at this website is truly superb.

A person essentially help to

A person essentially
help to make critically articles
I might state. This is the first time I frequented your
website page and to this point? I amazed with
the research you made to make this particular submit incredible.
Great job!|
Heya i am for the first time here. https://lapimbeche.com/collections/t-shirt

It's going to be ending of

It's going to be ending of mine day, however before end I am
reading this impressive post to increase my experience.

Excellent article. I'm going

Excellent article. I'm going through a few of these issues as well.. https://parbrize-online.ro/lunete/lunete-nissan.html

I do not know if it's just me

I do not know if it's just me or if everyone else encountering issues
with your site. It appears like some of the written text on your content are running
off the screen. Can somebody else please comment and let me
know if this is happening to them as well? This may be
a problem with my internet browser because I've had this happen previously.
Thank you

Thiis рost will asѕist the

Thiis рost will asѕist the iternet viewers for credating neѡ blog or even a blog
from stfart to end. http://shop.gmynsh.com/comment/html/?810090.html

Appreciate the

Appreciate the recommendation. Let me try it out.

Hmm it appears like your

Hmm it appears like your website ate my first comment (it was super long) so I guess I'll
just sum it up what I wrote and say, I'm thoroughly enjoying your
blog. I as well am an aspiring blog writer but I'm still new to the
whole thing. Do you have any helpful hints for rookie blog writers?
I'd genuinely appreciate it. https://anunturi-parbrize.ro/index.php?cauta=parbriz+daihatsu

Heya i am for the firѕt time

Heya i am for the firѕt time here. I fⲟund tһi boɑrd and I find It truly useful & it helped me out a lot.
I hoρe tto give something back and help others ⅼike yⲟu aided me. https://www.meetyobi.com/forums/users/leannebecerra5/

This is my first time visit

This is my first time visit at here and i am truly pleassant to read everthing at one place. https://parbrize24ore.ro/oferta-parbrize.php?an=2009&produs=geam+lateral...

I am genuinely thankful to

I am genuinely thankful to the owner of this web page who has shared this wonderful piece of writing at at
this place.

Sweet blog! I found it while

Sweet blog! I found it while surfing around on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Thank you

Awesome! Its really awesome

Awesome! Its really awesome paragraph, I have got much clear idea on the
topic of from this post.

Piece of writing writing is

Piece of writing writing is also a fun, if you be acquainted with afterward you can write or else it
is difficult to write. https://parbrize-online.ro/lunete/luneta-peugeot--2020-167737.html

http://winfullcapital.com/__m

Do you mind if I quote a

Do you mind if I quote a couple of your posts as long as
I provide credit and sources back to your blog?

My blog is in the very same area of interest as yours and my
users would truly benefit from some of the information you provide here.
Please let me know if this okay with you. Thanks!

Hi theгe, this weekend is

Hi theгe, this weekend is good in support of me, because this
point in time i am reаding this wonderful informative paragraph here at my һouse. https://www.bookmarks4all.win/klikbandar88-com

Great post. I'm experiencing

Great post. I'm experiencing many of these issues as well.. https://anunturi-parbrize.ro/parbriz-daewoo-16.html

magnificent points

magnificent points altogether, you simply gained a logo new reader.

What could you recommend about your put up that you just made some days ago?

Any positive?

Hmm it seems like your site

Hmm it seems like your site ate my first comment (it was
super long) so I guess I'll just sum it up what I had written and
say, I'm thoroughly enjoying your blog. I as well am an aspiring blog writer but
I'm still new to the whole thing. Do you have any suggestions for novice blog writers?
I'd really appreciate it. https://anunturi-parbrize.ro/index.php?page=1069

My programmer is trying to

My programmer is trying to persuade me to
move to .net from PHP. I have always disliked the idea because of the expenses.
But he's tryiong none the less. I've been using WordPress on a number of websites for about a year
and am nervous about switching to another platform.
I have heard great things about blogengine.net. Is there a way I can import all my wordpress content into it?

Any kind of help would be really appreciated!

Pеculiar article, ust what I

Pеculiar article, ust what I needed. https://independent-escortservice.de/author/cindipenrod/

Hello i am kavin, its my

Hello i am kavin, its my first occasion to commenting anywhere, when i read this post i
thought i could also create comment due to this sensible paragraph.

Very nice post. I just

Very nice post. I just stumbled upon your blog and wanted
to say that I have truly enjoyed surfing around your
blog posts. In any case I'll be subscribing to your feed
and I hope you write again soon!

Thіs design is wicked! You

Thіs design is wicked! You obviously know how to kkeep a reader amᥙsed.
Between your wit and your videos, I was almost moved too stаrt my own bl᧐g (well, almost...HaHa!) Fɑntastiuc job.
I really enjⲟyed what yoᥙ had to say, and more than that,
how you presented it. Too cool! https://x4wiki.grayghostindustries.com/index.php?title=User:Kellee26W533092

This is really

This is really attention-grabbing, You're an excessively professional blogger.

I've joined your feed and stay up for searching for more of your wonderful post.
Additionally, I have shared your web site in my social networks

I alpways used to read

I alpways used to read paragraph in news papers but now as І am a useг
of internet thus from now Ӏ am usіng net foг articles or reviews, tһanks to web.

Independance Immobilière -

Independance Immobilière - Agence Dakar Sénégal
Av. Fadiga, Immeuble Lahad Mbacké
BP 2975 Dakar
+221 33 823 39 30

Agence Immobilière Dakar

Hi everyone, it's my first pay a quick visit at this site,
and post is truly fruitful for me, keep up posting these articles.

Please let me know if you're

Please let me know if you're looking for a article writer for your weblog.
You have some really great articles and I believe I would be a good asset.
If you ever want to take some of the load off, I'd really like to write some material for your blog
in exchange for a link back to mine. Please blast me an e-mail
if interested. Cheers!

Hi there! This is my first

Hi there! This is my first visit to your blog! We are
a team of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us useful information to work on. You have done a extraordinary job!

Today, while I was at work,

Today, while I was at work, my sister stole my iPad and tested
to see if it can survive a twenty five foot drop, just so she can be a youtube sensation. My
iPad is now destroyed and she has 83 views.
I know this is entirely off topic but I had to share it
with someone!

Hey would you mind sharing

Hey would you mind sharing which blog platform you're working with?
I'm planning to start my own blog in the near future but
I'm having a difficult time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems different
then most blogs and I'm looking for something completely unique.

P.S Sorry for being off-topic but I had to ask!

Its like you read my mind!

Its like you read my mind! You seem to know
so much about this, like you wrote the book in it or something.
I think that you could do with a few pics to drive the message home a
bit, but other than that, this is fantastic blog.
A great read. I'll certainly be back.

Hello! I'm at work surfing

Hello! I'm at work surfing around your blog from my new iphone 3gs!
Just wanted to say I love reading your blog and look forward to all your posts!
Keep up the great work!

Hi! This is my first comment

Hi! This is my first comment here so I just wanted to give a quick shout
out and tell you I genuinely enjoy reading through your blog posts.
Can you suggest any other blogs/websites/forums that
go over the same subjects? Many thanks!

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.