earliest_day = 5; $this->latest_day = 20; } protected function get_all_posts() { // very quickly work out if we are sorting by cat or tag $cat = ''; if ($_POST['incategory'] != '') { $cat = '&cat=' . (int)$_POST['incategory']; } $tag = ''; if ($_POST['tagid'] != '') { $tag = "&tag_id=" . (int) $_POST['tagid']; } $all_posts = array(); $all_query = new WP_Query('showposts=' . $this->abs_max_posts . $cat . $tag); while($all_query->have_posts()) { $all_query->the_post(); $orig_date = get_the_date("Y-m-d H:i:s"); $i++; $all_posts[get_the_ID()] = array ( "link" => get_permalink(), "title" => the_title('','',false), "orig_date" => $orig_date, ); } return $all_posts; } public function redate_posts() { if (isset($_POST['latest_day']) && is_numeric($_POST['latest_day'])) { $this->latest_day = (int) $_POST['latest_day']; } if (isset($_POST['earliest_day']) && is_numeric($_POST['earliest_day'])) { $this->earliest_day = (int) $_POST['earliest_day']; } if ($this->earliest_day == 0 && $this->latest_day == 0) { echo "

Please go back - you cannot set latest and earliest at 0

"; return; } if ($this->earliest_day < 0 || $this->latest_day < 0 ) { echo "

Please go back - you cannot either value as lower than 0

"; return; } if ($_POST['tagid'] !='' && $_POST['incategory'] != '') { echo "

Please go back - you cannot set both slug and category!

"; return; } $total_diff_in_days = $this->latest_day + $this->earliest_day; echo "

Reordering

"; echo "

The earliest day is {$this->earliest_day} days ago. The latest day is {$this->latest_day} days in the future

"; $allposts = $this->get_all_posts(); if (count($allposts) > 0) { $doneDays = array(); echo ""; foreach($allposts as $id => $postData) { $link = $postData['link']; $title = $postData['title']; $random_days_behind = rand(0,$total_diff_in_days); $random_days_behind = (int) $random_days_behind; $day_diff = $random_days_behind - ($this->earliest_day ); if ($day_diff > 0) { $plus_minus = '+'; } else { $day_diff = abs($day_diff); // get positive $plus_minus = '-'; } $doneDays[str_replace("+","",$plus_minus) . $day_diff]++; $strtotimestring = $plus_minus . $day_diff . ' days'; $date_time = (strtotime($strtotimestring)); // H:i:s // get the year/mo/day from strtotime(- xx days) $newDate = date('Y-m-d', $date_time); // randomly select a hh:mm:ss to post $newDate.= " " . str_pad( rand(0,23) , 2, '0', STR_PAD_LEFT) . ":" . str_pad( rand(0,59) , 2, '0', STR_PAD_LEFT) . ":". str_pad( rand(0,59) , 2, '0', STR_PAD_LEFT) ; $updateArray = array( 'ID' => $id, 'post_date' => $newDate, 'post_date_gmt' => $newDate, 'edit_date' => true, ); $result = wp_update_post($updateArray); echo ""; } echo "
$id $link $title Original date: {$postData['orig_date']} Changed date to : $newDate
"; echo "

Counter:

"; ksort($doneDays); echo "

This shows the frequency of each post being posted x days ago/in future. It doesn't show every single day - only the ones with at least one post

"; //change for for() to show all days? might be handy echo ""; foreach($doneDays as $id => $val) { if ($id > 0) { $id = "+" . $id; } echo ""; } echo "
+/- daysNumber of posts
$id days$val posts
"; } else { echo "

Error - Could not find any posts to reorder!

"; } } protected function get_all_cats_options() { $args = array( 'type' => 'post', 'child_of' => 0, 'parent' => '', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => 1, 'hierarchical' => 1, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'category', 'pad_counts' => true ); $categories = get_categories( $args ); $returnhtml = ''; foreach($categories as $cat) { $id = $cat->cat_ID; $name = $cat->name; $c = $cat->category_count; $returnhtml .= ""; } return $returnhtml; } protected function get_all_tags_options() { $tags = get_tags(); $returnhtml = ''; if ($tags) { foreach ($tags as $tag) { $id = $tag->term_id; $name = $tag->name; $c = $tag->count; $returnhtml .= ""; } } else { $returnhtml = ""; } return $returnhtml; } public function show_options() { ?>

Ash's Random Post Dater

Use this form to set ALL posts in the selected category to a random date between these two values.

This will update the post dates on ALL posts within the selected category/tag (or ALL posts in your wordpress blog if both are set to default). Please do not use if you do not want to reset ALL post dates. I do not recommend using this on a site with lots of live posts - especially if you use a permalink structure that includes the date in the url. I use it on new sites (add all content, then set all posts to random date in the past). Use at your own risk! You will lose the current post date time (it only changes the date posted - nothing else)

Only use one of the following two. Leave both at their defaults ("ALL CATEGORIES"/"ALL TAGS") to reorder ALL posts

Reorder post dates in this category:


(leave on "ALL CATEGORIES" if you don't want to reorder all within a certain category)
OR

Reorder post dates with this tag slug (use the tag slug, not the tag):


(leave on "ALL TAGS" if you don't want to reorder all within a certain category)

Earliest Day - how many days back do you want the maximum one?

(put at 0 to put all posts in future)

Latest Day - Leave at 0 to make sure all posts are BACK dated.

(leave 0 to put all posts in past)

For example if you wanted your posts randomly set to a date in the next 30 days set the latest day as 30, the earliest day at 0

If you wanted your posts randomly set to a day in the previous 180 days then set the latest day as 0 and the earliest day as 180.

It randomly sets each post - the posts are not spaced out at exact intervals. It will readjust ALL your posts. Please make sure that you want ALL your posts to be randomised.

(Clicking this will randomly reorder all posts)
redate_posts(); } else { $random_post_dater->show_options(); } } It’s not charity: the rise of social enterprise in Vietnam – Social Care Team

It’s not charity: the rise of social enterprise in Vietnam

More work still needs to be done to dispel confusion surrounding social enterprises in Vietnam and help promote sustainable growth.

It’s mid-afternoon in the village of Duong O, Bac Ninh province, but Huong hasn’t got time to break for tea. She’s only halfway through the long, exhausting job of making a traditional paper called Do. It’s winter and her hands are raw from the process of dipping a framed screen into a trough of frigid water, raising the pulpy tree bark fibres from the surface and transferring them onto a board, where they will be pressed and dried to become a single sheet of paper.

On a good day, she can make around 800 pages, but it will take a month before the handmade paper is fit to sell. It’s no surprise that Houng’s family is one of only three left in the area – just a one-hour drive from Vietnam’s capital Hanoi – that is still involved in this disappearing tradition. The country has experienced rapid development over the last 30 years and the villagers are now using their skills to produce toilet paper and napkins instead.

She admits it’s difficult to convince her children that the hard labour involved in keeping this industry alive is worth it when the monetary rewards remain so meagre. Part of the problem is finding a reliable market for the products used for centuries by traditional calligraphers. Despite the high quality and durability of the paper, artists have moved on to work with other, cheaper, materials.

Social enterprise Zo wants to find a new way to keep the tradition alive. Its founder Hong Nhung is creating a demand for the paper by finding modern uses, such as lamps, notebooks, envelopes and greetings cards. Finding a market for the product is crucial, but it is just one piece of a complex puzzle.

“That’s why we chose the social enterprise model. It can make that link between the government, the villagers, the markets, the customers – all the actors in the value chain have to be involved. All are equally important.”

Nhung believes social enterprises are vital to meet the needs of a developing country where business and government struggle to solve continuing problems of poverty, social inequality and environmental pressures. Politicians appear to now recognise the role they play in the nation’s growth. Vietnam’s Enterprise Law was revised in 2014 to provide a legal definition of social enterprise, and the government promised to “encourage, support and promote the development of social enterprises”.

Social enterprise Zo wants to find a new way to keep the tradition alive. Its founder Hong Nhung is creating a demand for the paper by finding modern uses, such as lamps, notebooks, envelopes and greetings cards. Finding a market for the product is crucial, but it is just one piece of a complex puzzle.

“That’s why we chose the social enterprise model. It can make that link between the government, the villagers, the markets, the customers – all the actors in the value chain have to be involved. All are equally important.”

Nhung believes social enterprises are vital to meet the needs of a developing country where business and government struggle to solve continuing problems of poverty, social inequality and environmental pressures. Politicians appear to now recognise the role they play in the nation’s growth. Vietnam’s Enterprise Law was revised in 2014 to provide a legal definition of social enterprise, and the government promised to “encourage, support and promote the development of social enterprises”.

But what impact will this official recognition of social enterprise have for businesses on the ground?

Nguyen Dinh Nguyen, chief executive of Hanoi-based social enterprise Tohe, doubts the law will make any immediate difference. He says social enterprises are still misunderstood by both investors and customers, who remain skeptical about their motives, and adds that fear of corruption makes it a constant struggle to convince people that profits are going where social entrepreneurs claim. In Tohe’s case, this is to help provide art lessons and scholarships to disadvantaged children.

Nguyen says many business people use government connections to get ahead. The problem is complicated by the fact that a successful business in Vietnam is not about advertising, it’s about word of mouth. So without that customer loyalty, there is little hope of survival.

Awareness-raising would appear key to supporting the work of social enterprises in Vietnam. Duong Phuong Hanh, director of the Centre for Consultancy and Education of the Deaf and Hard of Hearing in Ho Chi Minh City, explains that until recently social enterprises were thought of as organisations that are similar to charities and rely on donations. Urgent work needs to be done to dispel this confusion.

Hanh, who has been deaf since she was six years old and uses a hearing aid, explains how despite studying hard to become a chemical engineer, her disability held her back and she was forced to accept a smaller wage compared to her hearing colleagues. She started CED to provide education for others like herself who have been marginalised because the current system provides little or no support for the disabled.

Hanh believes more efforts from the government to showcase the achievements of social enterprises will help her organisation gain support from mainstream society. She would also like to see more direct assistance in terms of business tax relief and help with rent of business properties. Social enterprises are currently treated on a par with other profit-driven business models, and Hanh admits she struggles to pay both her staff and herself a sufficient living wage.

“If I had more support from the government, I could improve the education of the deaf community,” she says. “We have many deaf people who can’t hear or speak, they just shake or nod their heads to communicate. I want to develop education of the deaf in Vietnam and make it a country where everyone, no matter what their ability, can contribute to society.”

Despite the challenges, Hanh remains optimistic. She says connections made with western nations such as the UK, where social enterprises are well established, are helping them learn more about how to make the business model a success.

“Vietnamese like the idea of social enterprises when they first learn about them,” she adds. “We are a traditional culture and love to share. That’s a good start for everyone who wants to establish social enterprises. Vietnamese people, however, still face problems with money and are therefore cautious about risking that prosperity. But if you help another person that makes you happy. So social enterprises should be welcomed in Vietnam.”

Capture29

http://www.theguardian.com/sustainable-business/2015/mar/31/its-not-charity-the-rise-of-social-enterprise-in-vietnam