Jump to content

azuka

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

About azuka

  • Birthday 11/13/1988

Contact Methods

  • AIM
    z4hym4k4
  • MSN
    azukadgreat@msn.com
  • Website URL
    http://www.zatechcorp.com
  • Yahoo
    zahymaka

Profile Information

  • Gender
    Not Telling
  • Location
    Nigeria

azuka's Achievements

Member

Member (2/5)

0

Reputation

  1. Have you tried urlencoding using HttpUtility.UrlEncode()?
  2. If you're using PHP 5 you need not worry about that. All objects are passed by reference and you don't get a copy unless you specifically clone the object.
  3. You're not very specific. Under what conditions would you get a string like that? There are many ways, some regex based, some not. At it's simplest I'd use $text = '4+1'; $text = substr($text, 0, 1); or $text = '4+1'; $text = current(explode('+', $text));
  4. I'm currently working on a website and had to write a joomla component to display videos [ see http://webdd.org/i55.org/index.php?option=com_experience&Itemid=29 ]. The client wanted to be able to upload a picture, have it resized and super-impose it on a bg, and add an arrow over the entire image. Please look at the above site in Firefox. I had problems getting the last image [ a transparent png file ] added to the image as the arrow part got colored according to the image underneath it. I decided to use the CSS hack, but since it's buggy in IE, I'm going back to the GD approach. Please advice me on this bit of code: [code]<?php //...some code before this $comp_dir = $mosConfig_absolute_path . '/administrator/components/com_experience/images/video-'; $filename = $dest_dir . strtolower($file['name']); // uploaded file $image = imagecreatefrompng( $comp_dir . 'bg.png' ); // base bg $arrow = imagecreatefrompng( $comp_dir . 'arrow.png' ); //arrow file $src = imagecreatefromjpeg( $filename ); //uploaded file //imageAlphaBlending($arrow, false); //tried this //imageSaveAlpha($arrow, false);    //and this -- didn't work $img_info = getimagesize($filename); //resize uploaded image ($src) and place on bg ($image) imagecopyresampled( $image, $src, 7, 8, 0, 0, 74, 66, $img_info[0], $img_info[1] ); //place arrow at position, 69, 60 on $image imagecopyresampled( $image, $arrow, 69, 60, 0, 0, 20, 23, 20, 23) ; unlink($filename); //delete uploaded file imagejpeg( $image, $filename ); // output jpeg file to $filename imagedestroy($image); //destroy imagedestroy($src); //all imagedestroy($arrow); //resources //... some code after this ?>[/code]
  5. azuka

    Tags Regex

    Thanks for the reply. I actually gave up on this topic and while browsing through the php.net function reference, discovered preg_replace_callback. Thanks all the same.
  6. azuka

    Tags Regex

    I'm nearly going crazy here, trying to get this stuff to run. Basically, I'm trying to capture the output from a script, use regex to transform it and so on. Here's what I have. I'm supposed to run through: [code]<li class="page_item"><a href="http://localhost/blog/about-me/" title="About Me">About Me</a><ul> <li class="page_item"><a href="http://localhost/blog/about-me/underling1/" title="Underling1">Underling1</a> </li> <li class="page_item"><a href="http://localhost/blog/about-me/underling2/" title="Underling2">Underling2</a> </li> </ul> </li> <li class="page_item"><a href="http://localhost/blog/calendar/" title="Calendar">Calendar</a></li> <li class="page_item"><a href="http://localhost/blog/contact/" title="Contact">Contact</a></li> <li class="page_item"><a href="http://localhost/blog/links/" title="Links">Links</a></li>[/code] remove all the 'li's inside uls and integrate them, separating them by commas. Ie [list] [*]About Me[/list]     [list]     [*]Underling1     [*]Underling2     [/list] [list][*]Calendar [*]Contact [*]Links[/list] Should be changed to [list] [*]About Me[/list]     [list]     [*]Underling1, Underling2     [/list] [list][*]Calendar [*]Contact [*]Links [/list] I've tried using the simple regular expression "/\<ul\>(.*?)\<\/ul\>/e" but it simply does nothing. When I replace the /e with /is, replacements occur. unfortunately, what I need to do is apply a function to the captured text with preg_replace. SO gar, I haven't been successful. Does anyone have an idea?[/list]
  7. Do we have to argue about constants breaking encapsulation? What if [using PHP 5's features] you create a class with a static array and build static functions that allow you to add and retrieve permission 'constants' ie array keys? Everyone decides what's best for him and works with it. As for the tutorial, I do understand binary and hex but never thought of the bitwise operators this way. Thanks for the [url=http://www.phpfreaks.com/forums/index.php/topic,110890.msg450649.html#msg450649]tutorial[/url]. Now I know just what to do to implement a permission-based system.
  8. I'm afraid some of the replies here are a bit vague. Is there somewhere I could get some tutorials [or a book] on implementing a PHP-based permissions system?
  9. azuka

    XmlRPC

    I'm working on a little CMS for myself to put my writing -- I had something at http://books.zatechcorp.com but I'm currently rewriting the codebase to make for easy extensibility and more features [RSS and commenting]. I was wondering if anyone can point me to some good xmlRPC resources -- I'd prefer a book I can buy because I prefer print to reading on screen.
  10. Thanks everyone for the help. I was really hoping I'd be able to find some information on it.  :-\ . Well, I'll check out the reflection API. PHPFreaks rocks...
  11. Like I said, everything is abstracted so the CMS doesn't care where the data is coming from - MySQL, MSSQL, or using PEAR itself. This isn't a traditional 'CMS' that fits generic purposes. It's geared specially towards writers. phpfreak101, isn't PHPNuke rather complex? I thought there'd be perhaps some CMS or some tutorial that shows how to create a plugin system whose APi you can expose? Studying the entire PHPNuke CMS sounds like overload to me. Of course, I could be wrong...
  12. If you want it to be case-insensitive, you might consider using eregi() or stripos()
  13. [!--quoteo(post=383191:date=Jun 13 2006, 06:27 AM:name=coldkill)--][div class=\'quotetop\']QUOTE(coldkill @ Jun 13 2006, 06:27 AM) [snapback]383191[/snapback][/div][div class=\'quotemain\'][!--quotec--] It didn't work. Although i updated the JS code because i looked at it and it was actually saying "When the checkbox IS ticked disabled the button else disable the button" ¬¬. [/quote] I'm assuming your form code looks something like [code]<form name="sign_up" id="sign_up" action="#####" method="post"> <!-- Other content goes here --> <input type="checkbox" name="tos" id="tos" onclick="validate_tos(this)" /> <input type="submit" name="x_submit" value="x_submit" disabled="disabled" /> </form>[/code] Add this function to your script in your head tag [code] function validate_tos(theCheckBox){     if (theCheckBox.checked == true) theCheckBox.form.x_submit.disabled = false;     else theCheckBox.form.x_submit.disabled = true; }[/code] I tried it myself.
  14. Well, there's a file called 'functions.php' which includes 'normal' function files and another called 'admin-functions.php' which includes admin-specific files so I get your point. I have to admit I've been very busy and haven't touched my code for two weeks now. I'll work on it. Perhaps my biggest problem is that I'd never written a CMS before [I started programming last year] so I get scared that I'm leaving security holes open and such, even though I keep current with security practices. Does having a plugin system leave the system open to vulnerabilities? On the other hand, I want others to be able to extend my work without having a need to rewrite major portions of code to suit themselves, then having problems upgrading.
  15. [!--quoteo(post=383151:date=Jun 13 2006, 04:17 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ Jun 13 2006, 04:17 AM) [snapback]383151[/snapback][/div][div class=\'quotemain\'][!--quotec--] what in php like a built in text editor and sorry forthe confussion you project is 10/10 is it gpl [/quote] Well, it's quite personal, although I don't mind releasing the code. I'm an amateur writer and I needed something for online purposes. Some people have met me online indicating interest in it so I'm trying to work on it and ensure that if other developers work on it with me, we won't need to do a complete rewrite.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.