aminb5
Forum Replies Created
-
Forum: Hacks
In reply to: unlink() doesn't delete the file!your absolutely right.
This is what I came up at last :
//remove previous uploaded file $author_data = get_the_author_meta( 'profile_photo', $user_id ); $author_data["file"] = $uploads["path"] . $author_data["file"]; $imagepath = $author_data["file"]; @unlink($imagepath);
Forum: Hacks
In reply to: unlink() doesn't delete the file!Yeah your right!
maybe something like this is better: ?
//remove previous uploaded file $author_profile_photo = get_author_profile_photo($user_id); $httpurl = $author_profile_photo["file"]; $url=url_to_path_test($httpurl); @unlink($url);
and of course I have to declare the function url_to_path_test() too.
Forum: Hacks
In reply to: unlink() doesn't delete the file!Ok, I figured it out!
I did some searching and I found this line of code that converts the url to path:
function url_to_path_test($url){ $url=str_replace(rtrim(get_site_url(),'/').'/', ABSPATH, $url); return $url; }
So I did it like this in my code:
//remove previous uploaded file $author_bank_resid = get_author_bank_resid($user_id); $url=str_replace(rtrim(get_site_url(),'/').'/', ABSPATH, $author_bank_resid["file"]); @unlink($url);
Thanks a lot for guiding me in the right direction!
Regards.
Forum: Hacks
In reply to: unlink() doesn't delete the file!Yeah I put the wp_die(‘erorr!’) thing and when uploading it died! and showed the erorr!
I’m guessing it’s either the path thing or the permissions.
Any idea how I have to get the path like this: /path/to/file.jpg
??Forum: Hacks
In reply to: unlink() doesn't delete the file!WP_DEBUG is true and I removed the @ from the beginning of unlink() but no error messages!
Forum: Hacks
In reply to: unlink() doesn't delete the file!I put the exit($author_profile_photo([“file”])); above the unlink link and when uploading it shows the url like this :
https://SITENAME/wp-content/uploads/2013/10/IMAGENAME.pngSo do I have to check the permissions? How do I have to do that? Can you please guide me on that? I’m not familiar with it!
Regards!
Thanks, looking forward to it.
Regards.
Forum: Hacks
In reply to: how to add multiple Authors to a post?Thanks bcworkz for the reply.
Yeah I think I have to find a way to do that, but I haven’t figured it out yet.
I will leave this topic open for now to see if anyone else can give a detailed solution.
Regards.
Forum: Themes and Templates
In reply to: trouble with the width of center algined images!problem solved!
I fixed it by changing the margin left and right from auto to 39%!
and of course changing display block to display inline!Regards!
Forum: Themes and Templates
In reply to: trouble with the width of center algined images!Thank you for your time, appreciate it!
I’ll leave this topic unsolved for a few days, see if anyone can find it’s problem!
Regards
Forum: Themes and Templates
In reply to: trouble with the width of center algined images!Thank you, but when I do that, the image aligns on the right side!
I tried ‘display: inline’ too, but it still aligns on the right instead of the center!Forum: Themes and Templates
In reply to: trouble with the width of center algined images!Well I wrote the codes, but if you need to see an example of it, here is an online one :
Example
in the page above you can see that the images are 400px × 300px, but when you hover the mouse on the left and right side of the images it still links to the image!Forum: Themes and Templates
In reply to: trouble with the width of center algined images!The HTML is just the wordpress content structure :
<div id="primary"> <?php if(have_posts()) : while(have_posts()) : the_post(); ?> <div class="content"> <h2 class="content-title"><a href="<?php the_permalink() ?>"> <?php the_title(); ?> </a></h2> <p class="meta">????? ??? ???? <?php the_author(); ?> ?? ????? <?php echo the_date('j F, Y'); ?> </p> <?php the_content('????? ????...'); ?> </div> <!-- end post-item --> <?php endwhile; ?> <?php else : ?> <p>????? ????? ????? ?? ?? ??????!</p> <?php endif; ?> <div id="comments_template"> <?php comments_template(); ?> </div><!-- end comments_template --> </div><!-- end primary --> </div> <!-- / end of main -->
and this is how it’s shown in the browser :
<div id="primary"> <div class="content"> <h2 class="content-title"> <p class="meta">????? ??? ???? ???? ???? ?? ????? ?? ???, ???? </p> <p> <a rel="attachment wp-att-220" href="https://localhost/tthemesf/?attachment_id=220"> <img class="aligncenter size-medium wp-image-220" width="150" height="150" alt="" src="https://localhost/tthemesf/wp-content/uploads/2012/07/dtutslogo4fb-150x150.png" title="dtutslogo4fb"> </a> </p> <p> </p> </div> <div id="comments_template"> </div>
thank you!
Forum: Fixing WordPress
In reply to: how to decode wordpress password hash?!thanks you!