Request for there code

Malik Umer Farooq Posted in Component Development 7 years ago

request for there code i dont know in which file i need add following code in order to work

<?php
     $words = explode(" ",ossn_print("post"));
     foreach($words as $word){

         if(substr($word, 0, 1)=== "@"){
        echo "<a href="ossn_site_url(substr($word, 1))">".htmlspecialchars($word)."</a> ";
     }
     elseif(substr($word,0,1)==="+"){
        echo "<a href="tel:" .substr($word, 1).""target="_blank">".escape($word)."</a> ";
    }
     elseif(substr($word,0,1)==="$"){
        echo "<a href="https://www.google.com#q=" .substr($word, 1)."">".escape($word)."</a> ";
    }
     elseif(substr($word,0,1)==="!"){
    //code for open article in wikipedia
    }
     elseif(substr($word,0,1)==="#"){
        //code for hashtag
     }

     else{
         echo " $word ";
     }
     }

    ?>
Replies
pk Malik Umer Farooq Replied 7 years ago

Basically sir I ant to print post not language string ...with these feature...

pk Malik Umer Farooq Replied 7 years ago

Sir I want to print post I see ossn_print(&quot;post&quot;); in ossn wall component
I want to print post , I don't know where I add these code in order to work
This code have feature @mention and others As you seen in code

German Michael Zülsdorff Replied 7 years ago

If not for returning a language string,
for what reason are you using ossn_print() then?

pk Malik Umer Farooq Replied 7 years ago

Sir as you say

> there's no need to parse a language string again from outside

There is no Language code I am not understand you. !!!

German Michael Zülsdorff Replied 7 years ago

Since what we call an "Ossn language file" is regular PHP code and will be parsed accordingly, there's no need to parse a language string again from outside - you can put your code and/or html directly into the language file instead.
Even more, the idea looks rather strange: because calling ossn_print() this way WILL in fact echo a CONSTANT retrieved by that given key. Thus you would know in advance what "post" should give and there's no need to build that complicated stuff around.