Home Forum
2024-05-14
Benvenuto, Ospite
Nome Utente Password: Ricordami

Using redj to mask dynamic PHP with image ext.
(1 Online) (1) Ospite
  • Pagina:
  • 1
  • 2

ARGOMENTO: Using redj to mask dynamic PHP with image ext.

Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #683

  • dirtydoug
  • Offline
  • Fresh Boarder
  • Messaggi: 6
i wonder if this is possible with redJ. Guys i am in need of a big help with SEO experts this is about making SEF urls. Anyway i have a plugin which makes a dynamic images i use this to generate a badges for my users to share their profile badge to other websites but unfortunately some forums esp. kunena only recognize .png, .gif and .jpg file extension so what i wanted to do is make my original URL which is

k9.com/plugins/community/badge/b ... ?userid=71

to

k9.com/plugins/community/badge/badge71.png

i have searched all over the web and come up with these rewrite rule but this only works on plain php website and im having a hard time implementing this to joomla. This is the code to be added on .htaccess

Code:
RewriteEngine on
RewriteRule ^badge([0-9]{1,})\.png$ badge.php?userid=$1


with this piece of code it turns any badge.php?userid=n to nbadge.png

hope someone here can help me and this is pretty useful too for others.

Thanks in advance and i hope i have written my concern on the appropriate forum.
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #688

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Hi,
ReDJ only makes redirect and only works into Joomla CMS.

What you need, instead, seems to be url rewriting. Looking at your example, you are on the right way, but if you want to do URL rewriting into Joomla this may be a problem...

It's a problem because "URL Rewrite" is a process that happens into Apache BEFORE to serve any file (and not only PHP files).

Once landed into a php page (e.g. a Joomla page) you can't rewrite the url, you just can do two things. Send to a browser a redirect to a new destination (what ReDJ does), or serve to the client browser a different file.

In the latter case, calling the URL:

k9.com/plugins/community/badge/badge.php?userid=71

You can write into badge.php some php code that sends back a stream of badge71.png image file. I've created something like this to have a basic "proxy" to bypass some firewall rules...

Regards,
Luigi
Ultima modifica: 14 Anni, 6 Mesi fa Da admin.
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #691

  • dirtydoug
  • Offline
  • Fresh Boarder
  • Messaggi: 6
geez so this is not as easy as i think cause you know when it comes to dynamic using joomla you need to find the user id to show off that certain users info and that results this url k9.com/plugins/community/badge/badge.php?userid=71 well to be honest i can just make it easy to display on other sites just simply insert html code like this <img src="k9.com/plugins/community/badge/badge.php?userid=71"/> and its done a dynamic image that pulls out and show the info of user71 but unfortunately some website including kunena does not accept this certain code so it has to be <img src="k9.com/plugins/community/badge/badge.png"/> cause kunena doesnt allow php .. so sad.. oh well!
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #702

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
If you want to insert custom php code in your pages, there are a lot of Jooma extensions you can use.

Custom code in content
extensions.joomla.org/extensions/edition/custom-code-in-content

Custom code in module
extensions.joomla.org/extensions/edition/custom-code-in-modules

I use includePHP, a little plugin that allows including php, javascript and HTML in content:

extensions.joomla.org/extensions/edition/custom-code-in-content/2921

Another way is to search for a Kunena plugin. I can help you but you should provide more details on what you want to do.

Regards,
Luigi
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #705

  • dirtydoug
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Thanks for the response admin i just hope that there is a paid professional service for this i already place a bid on joomlancer but no one responded, anyway if i will only use the badge on my site there is no problem on embedding it even if the badges ends with php?userid=71 extension but my concern is that it is not accepted on some phpbb forums, that is according to my users that they want to insert their badge on the phpbb3 forums but the embed code which is

k9.com/plugins/community/badge/badge.php?userid=71

is not accepted so what they do is save the image to their computer and upload it to 3rd party hosting but the badge is not dynamic anymore so thats a big problem.
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #707

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Could you, please, post a real "badge" URL?

k9.com/plugins/community/badge/badge.php?userid=71

Doesn't work and I like to understand what we are talking on...

Anyway, on any external forum you can't do so much (just because they are "external").

But I'm thinking to a possible solution (that should be verified). If the external site allows you to put a link to an external image (e.g. k9.com/plugins/community/badge/badge71.png), than you can use internal URL rewrite on k9.com to serve a dynamic image. This can be done. The only problem could be, if the external site loads the image una-tantum (i.e. when you post the link), this always be static, not dynamic (remains the same) and there's nothing you can do.

What do you think?

Luigi
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #716

  • dirtydoug
  • Offline
  • Fresh Boarder
  • Messaggi: 6
Hi, i would like to know your idea. Here is the real link i am sorry i didnt post it earlier.

<click here for the badge>

I'd really love to see your solution. Its just so amazing that you pay attention to my concern even if its totally not related to your product i am just happy to stop by atleast even if my problem would not be solve its really appreciated cause atleast someone replied to me and willing to help not like on the other sites.
Ultima modifica: 14 Anni, 6 Mesi fa Da dirtydoug.
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #718

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
Thanks for the compliments,
but just as example, I've tried to implement what I said. I've created two files in the root folder of my local Apache.

The first one (imagetest.php) dinamically generate a simple image box with a number inside. The number comes from the userid parameter:

http://localhost/imagetest.php?userid=555


Than, I've added a rewrite rule to Apache, using a local .htaccess file:

RewriteEngine On
RewriteRule userimage(.*).jpg /imagetest.php?userid=$1


So, I can call a static image URL, but really the image is dinamically generated:

http://localhost/userimage555.jpg


This could be a possible solution to your problem.

Regards,
Luigi

I file di questo Forum sono invisibili ai visitatori. Prego accedi o registrati per visualizzarli.
Allegati:
  • Allegato I file di questo Forum sono invisibili ai visitatori. Prego accedi o registrati per visualizzarli.
Ultima modifica: 14 Anni, 6 Mesi fa Da admin.
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #719

  • dirtydoug
  • Offline
  • Fresh Boarder
  • Messaggi: 6
hi just one question on which directory should i upload the .htaccess? cause if i upload it on root it will surely overwrite my .htaccess

sorry for the dumb question i just dont know how.
L'Argomento è stato bloccato.

Re:Using redj to mask dynamic PHP with image ext. 14 Anni, 6 Mesi fa #720

  • admin
  • Offline
  • Administrator
  • Messaggi: 1603
If you already have a .htaccess file, you don't need to overwrite it. Just add my rule to yours. To be sure that other rules didn't conflict with this, add the rule just after RewriteEngine option:

RewriteEngine On
RewriteRule userimage(.*).jpg /imagetest.php?userid=$1


Regards,
Luigi
Ultima modifica: 14 Anni, 6 Mesi fa Da admin.
L'Argomento è stato bloccato.
  • Pagina:
  • 1
  • 2
Moderatori: admin
Tempo generazione pagina: 0.78 secondi
Cerca con Google
News
Chi è online
 92 visitatori online
Sponsor

slotmachineaamsonline.com è una guida alle migliori slot machine online legali in Italia. Sul sito trovi un elenco sempre aggiornato dei casino online con Slot machine e bonus slot, le ultime novità dal mondo delle slot online e le migliori strategie per vincere. Inoltre, è disponibile una sezione dedicata alle slot machine da BAR che finalmente sono disponibili nella versione online.