Page 1 of 2

WP Dooplay

Posted: 10 Jun 2018, 11:43
by BogdanFSro
Salut.
Pentru cei care cunosc tema Dooplay wordpress de filme si seriale.
Am o nelamurire.
Este posibil sa modific ca din "nume.ro/serial/lucifer-1x1/" sa fac "nume.ro/serial/lucifer-sezonul-1-episodul-1/" ?
Stiu sa modific permalink-ul dar n-are nici o legatura.
Am gasit codul de mai jos,dar si daca-l modific nu merge...

Code: Select all

							$dt_episodes = array(
								'post_title' => dt_clear($tituloserie. ": ".eseas.$season.esepart.eepisod.  $episode),
								'post_content' => dt_clear($overview),
								'post_status' => 'publish',
								'post_type' => 'episodes',
								'post_author' => 1
							);
Normal cand dai import la un episod se pune titlul sus automat,dupa care si permalink-ul se face dupa titlu.

Re: WP Dooplay

Posted: 10 Jun 2018, 14:16
by zigweed
Ai dat reset permalink dupa ce ai facut modificarea ?

Re: WP Dooplay

Posted: 12 Jun 2018, 16:24
by BogdanFSro
Nu,o sa incerc acum si revin cu edit.

Later edit :100: Image
Nu cred ca are vreo legatura permalink-ul cu ce vreau eu sa fac? :-s

Re: WP Dooplay

Posted: 12 Jun 2018, 16:27
by The Kalu
Are legatura cu pretty URL aka URL rewrite, vezi si tu ce inseamna permalink si apoi te apuci de treaba.

Re: WP Dooplay

Posted: 12 Jun 2018, 16:30
by BogdanFSro
The Kalu wrote:Are legatura cu pretty URL aka URL rewrite, vezi si tu ce inseamna permalink si apoi te apuci de treaba.
Am nevoie de cineva care stie php... :-??
vezi aici codul | Afiseaza codul
[code]/* POST Episodes ( wp-admin ) AJAX
-------------------------------------------------------------------------------
*/
function dt_post_episodes_ajax() {
	if( isset( $_GET['episodes_nonce'] ) and wp_verify_nonce($_GET['episodes_nonce'], 'add_episodes') ) {
		if (current_user_can('manage_options')) {
			if (dttp == "valid") {
				if (($_GET["se"] != NULL) && ($_GET["te"] != NULL)) {
					$dtemporada = $_GET["te"];
					$ids = $_GET["se"];
					if (($ids != NULL) && ($dtemporada != NULL)) {
						$urltname = wp_remote_get(tmdburl."tv/".$ids."?&language=".tmdblang."&include_image_language=".tmdblang.",null&api_key=".tmdbkey);
						$json2 = wp_remote_retrieve_body($urltname);
						$data2 = json_decode($json2, TRUE);
						$tituloserie = $data2['name'];
						$urltoc = wp_remote_get(tmdburl."tv/".$ids."/season/".$dtemporada."?append_to_response=images,trailers&language=".tmdblang."&include_image_language=".tmdblang.",null&api_key=".tmdbkey);
						$json1 = wp_remote_retrieve_body($urltoc);
						$data1 = json_decode($json1, TRUE);
						$sdasd = count($data1['episodes']);
						$poster_serie = $data1['poster_path'];
						for ($cont = 1; $cont <= $sdasd; $cont++) {
							$url = wp_remote_get(tmdburl.'tv/'.$ids.'/season/'.$dtemporada.'/episode/'.$cont.'?append_to_response=images&language='.tmdblang.'&include_image_language='.tmdblang.',null&api_key='.tmdbkey);
							$json = wp_remote_retrieve_body($url);
							$data = json_decode($json, TRUE);
							$season = $data['season_number'];
							$episode = $data['episode_number'];
							$name = $data['name'];
							$dmtid = 'tv'.DT_STRING_LINK.$data['id'];
							$overview = $data['overview'];
							if($metadate = $data['air_date'] ) {
								$air_date = $metadate;
							} else {
								$air_date = date('Y-m-d');
							}
							$still_path = $data['still_path'];
							if ($get_img = $data['still_path']) {
								$upload_img = 'https://image.tmdb.org/t/p/w500' . $get_img;
							}
							$crew = $data['crew'];
							$guest_stars = $data['guest_stars'];
							$images = $data['images']["stills"];
							$castor = $img = $cast = $director = $writer = "";
							foreach($crew as $valor) {
								$departamente = $valor['department'];
								if ($valor['profile_path'] == NULL) {
									$valor['profile_path'] = "null";
								}
								if ($departamente == "Directing") {
									$director.= $valor['name'] . ",";
								}
								if ($departamente == "Writing") {
									$writer.= $valor['name'] . ",";
								}
							}
							$i = '0';
							foreach($guest_stars as $valor1) if ($i < 3) {
								if ($valor1['profile_path'] == NULL) {
									$valor1['profile_path'] = "null";
								}
								$castor.= $valor1['name'] . ",";
								$i +=1;
							}
							$i = '0';
							foreach($images as $valor2) if ($i < 10) {
								$img.= $valor2['file_path'] . "\n";
								$i +=1;
							}
							$dt_episodes = array(
								'post_title' => dt_clear($tituloserie. ": ".eseas.$season.esepart.eepisod.  $episode),
								'post_content' => dt_clear($overview),
								'post_status' => 'publish',
								'post_type' => 'episodes',
								'post_author' => 1
							);
							$post_id = wp_insert_post($dt_episodes);
							add_post_meta($post_id, "ids", ($ids) , true);
							add_post_meta($post_id, "temporada", ($season) , true);
							add_post_meta($post_id, "episodio", ($episode) , true);
							add_post_meta($post_id, "serie", ($tituloserie) , true);
							add_post_meta($post_id, "episode_name", ($name) , true);
							add_post_meta($post_id, "air_date", ($air_date) , true);
							add_post_meta($post_id, "imagenes", ($img) , true);
							add_post_meta($post_id, "dt_backdrop", ($still_path) , true);
							add_post_meta($post_id, "dt_poster", ($poster_serie) , true);
							add_post_meta($post_id, "dt_string", ($dmtid) , true);
							dt_upload_image($upload_img, $post_id);
						}
					}
					update_post_meta($_GET["link"], 'clgnrt', '1');
					wp_redirect( get_admin_url() . "edit.php?post_type=seasons");
					exit;
				}
				else {
					echo 'error';
					exit;
				}
			}
			else {
				echo 'invalid license';
				exit;
			}
		}
		else {
			echo 'login';
			exit;
		}
	}
	die();
}
add_action('wp_ajax_episodes_ajax', 'dt_post_episodes_ajax');
add_action('wp_ajax_nopriv_episodes_ajax', 'dt_post_episodes_ajax');

/* POST Episodes ( front-end ) AJAX
-------------------------------------------------------------------------------
*/
function dt_post_episodes_front_ajax() {
	if( isset($_GET['episodes_nonce'] ) and wp_verify_nonce($_GET['episodes_nonce'], 'add_episodes') ) {
		if (current_user_can('manage_options')) {
			if (dttp == "valid") {
				if (($_GET["se"] != NULL) && ($_GET["te"] != NULL)) {
					$dtemporada = $_GET["te"];
					$ids = $_GET["se"];
					if (($ids != NULL) && ($dtemporada != NULL)) {
						$urltname = wp_remote_get(tmdburl."tv/".$ids."?&language=".tmdblang."&include_image_language=".tmdblang.",null&api_key=".tmdbkey);
						$json2 = wp_remote_retrieve_body($urltname);
						$data2 = json_decode($json2, TRUE);
						$tituloserie = $data2['name'];
						$urltoc = wp_remote_get(tmdburl."tv/".$ids."/season/".$dtemporada."?append_to_response=images,trailers&language=".tmdblang."&include_image_language=".tmdblang.",null&api_key=".tmdbkey);
						$json1 = wp_remote_retrieve_body($urltoc);
						$data1 = json_decode($json1, TRUE);
						$sdasd = count($data1['episodes']);
						$poster_serie = $data1['poster_path'];
						for ($cont = 1; $cont <= $sdasd; $cont++) {
							$url = wp_remote_get(tmdburl.'tv/'.$ids.'/season/'.$dtemporada.'/episode/'.$cont.'?append_to_response=images&language='.tmdblang.'&include_image_language='.tmdblang.',null&api_key='.tmdbkey);
							$json = wp_remote_retrieve_body($url);
							$data = json_decode($json, TRUE);
							$season = $data['season_number'];
							$episode = $data['episode_number'];
							$name = $data['name'];
							$dmtid = 'tv'.DT_STRING_LINK.$data['id'];
							$overview = $data['overview'];
							if($metadate = $data['air_date'] ) {
								$air_date = $metadate;
							} else {
								$air_date = date('Y-m-d');
							}
							$still_path = $data['still_path'];
							if ($get_img = $data['still_path']) {
								$upload_img = 'https://image.tmdb.org/t/p/w500' . $get_img;
							}
							$crew = $data['crew'];
							$guest_stars = $data['guest_stars'];
							$images = $data['images']["stills"];
							$castor = $img = $cast = $director = $writer = "";
							foreach($crew as $valor) {
								$departamente = $valor['department'];
								if ($valor['profile_path'] == NULL) {
									$valor['profile_path'] = "null";
								}
								if ($departamente == "Directing") {
									$director.= $valor['name'] . ",";
								}
								if ($departamente == "Writing") {
									$writer.= $valor['name'] . ",";
								}
							}
							$i = '0';
							foreach($guest_stars as $valor1) if ($i < 3) {
								if ($valor1['profile_path'] == NULL) {
									$valor1['profile_path'] = "null";
								}
								$castor.= $valor1['name'] . ",";
								$i +=1;
							}
							$i = '0';
							foreach($images as $valor2) if ($i < 10) {
								$img.= $valor2['file_path'] . "\n";
								$i +=1;
							}
							$dt_episodes = array(
								'post_title' => dt_clear($tituloserie. ": ".eseas.$season.esepart.eepisod. $episode),
								'post_content' => dt_clear($overview),
								'post_status' => 'publish',
								'post_type' => 'episodes',
								'post_author' => 1
							);
							$post_id = wp_insert_post($dt_episodes);
							add_post_meta($post_id, "ids", ($ids) , true);
							add_post_meta($post_id, "temporada", ($season) , true);
							add_post_meta($post_id, "episodio", ($episode) , true);
							add_post_meta($post_id, "serie", ($tituloserie) , true);
							add_post_meta($post_id, "episode_name", ($name) , true);
							add_post_meta($post_id, "air_date", ($air_date) , true);
							add_post_meta($post_id, "imagenes", ($img) , true);
							add_post_meta($post_id, "dt_backdrop", ($still_path) , true);
							add_post_meta($post_id, "dt_poster", ($poster_serie) , true);
							add_post_meta($post_id, "dt_string", ($dmtid) , true);
							dt_upload_image($upload_img, $post_id);
						}
					}
					update_post_meta($_GET["link"], 'clgnrt', '1');
					wp_redirect(get_permalink( $_GET["link"] ));
					exit;
				}  else {
					echo 'error';
					exit;
				}
			} else {
				echo 'invalid license';
				exit;
			}
		} else {
			echo 'login';
			exit;
		}
	}
	die();
}
add_action('wp_ajax_seasonsf_ajax', 'dt_post_episodes_front_ajax');
add_action('wp_ajax_nopriv_seasonsf_ajax', 'dt_post_episodes_front_ajax');
[/code]

Re: WP Dooplay

Posted: 12 Jun 2018, 22:30
by The Kalu
Mai baiatule este vorba de url rewrite si htaccess, ce nu intelegi romaneste.

Re: WP Dooplay

Posted: 12 Jun 2018, 22:38
by BogdanFSro
The Kalu wrote:Mai baiatule este vorba de url rewrite si htaccess, ce nu intelegi romaneste.
Ma amuzi , "mai baiatule" , nu are nici o legatura ce spui tu cu ce vreau eu. :)

Re: WP Dooplay

Posted: 13 Jun 2018, 11:51
by C r A z Y
Daca ai cumparat tema, te ajuta cei de la support.

Re: WP Dooplay

Posted: 13 Jun 2018, 12:24
by BogdanFSro
C r A z Y wrote:Daca ai cumparat tema, te ajuta cei de la support.
Cica o sa fie posibil in urmatorul update.

Re: WP Dooplay

Posted: 13 Jun 2018, 12:58
by Mr.Dr.Sir.Go
Poti incerca acest plugin , pana iti gasesti pe cineva sa iti modifice tema.
https://wordpress.org/plugins/custom-permalinks/

Re: WP Dooplay

Posted: 14 Jun 2018, 19:32
by BogdanFSro
Mr.Dr.Sir.Go wrote:Poti incerca acest plugin , pana iti gasesti pe cineva sa iti modifice tema.
https://wordpress.org/plugins/custom-permalinks/
Multumesc.
Am reusit sa fac cu acest plugin,folosesc si ceva SEO,si la acela daca modificam permalink-ul nu mergea,acum vad ca merge.
Se poate da t/c

Re: WP Dooplay

Posted: 14 Jun 2018, 20:26
by Mutex
BogdanFSro wrote:
Mr.Dr.Sir.Go wrote:Poti incerca acest plugin , pana iti gasesti pe cineva sa iti modifice tema.
https://wordpress.org/plugins/custom-permalinks/
Multumesc.
Am reusit sa fac cu acest plugin,folosesc si ceva SEO,si la acela daca modificam permalink-ul nu mergea,acum vad ca merge.
Se poate da t/c

Inainte de asta as vrea sa incerci si modificare fara plugin pentru ca se poate + update la permalink-uri din setari + iti recomand instalarea modulului 404 to 301.