Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Ryan11433 Posted August 23, 2011 Posted August 23, 2011 Why is the data not parsing in IPB 3.2 BUT It is in IPB 2.3.6 [My mod source for IPB 2]function miniplaylist( ) { $limit=5; $this->ipsclass->input['page'] ? $page = intval($this->ipsclass->input['page']) : $page=0; if ($limit < 1) {$limit=1;} if ($page < 0) {$page=0;} $query = "SELECT * FROM ibf_nmplaylist WHERE mid = '". $this->ipsclass->member['id'] ."' ORDER BY name ASC"; $this->ipsclass->DB->query("SELECT * FROM ibf_nmplaylist WHERE mid = '". $this->ipsclass->member['id'] ."' ORDER BY name ASC"); $numresults=mysql_query($query); $numrows = $this->ipsclass->DB->get_num_rows($numresults); $pages = ceil($numrows/$limit); // Number of results pages. $query .= " LIMIT $page,$limit"; $result = mysql_query($query); $count = $page + 1; $ncount = 0; $ncount++; if ($pages < 1){ $total = 1;} // If $pages is less than one , total pages is 1. else { $total = $pages;} // Else total pages is $pages value. $first = $page + 1; // The first result. if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) { $last = $page + $limit;} //If not last results page, last result equals $page plus $limit. else{ $last = $numrows;} // If last results page, last result equals total number of results. $current = intval($page/$limit) + 1; // Current page number. // calculate number of pages needing links $pages= intval($numrows/$limit); if ($numrows%$limit) { // has remainder so add one page $pages++; } $more = true; $less = true; $back_page = $page - $limit; if ($back_page < 0) { $back_page = 0;} if ($page!=0) { $tmps = "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$back_page}'><< previous</a> - "; } $limitnum = 5*$limit; for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page) { $tmps .= "[<b>$i</b>] "; // Current page doesn't need a link, just text. } elseif ($ppage < $page - $limitnum){ if ($less){$tmps .= " ... ";}; $less = false; } elseif ($ppage > $page + $limitnum){ if ($more){$tmps .= " ... ";}; $more = false; } else{ $tmps .= "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page=$ppage'>$i</a> "; } } if(($current) <= ($total-7)){ $tmps .= "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page=".$ppage."'>$total</a> "; } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { $next_page = $page + $limit; $tmps .= " - <a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$next_page}'>next >></a> "; } $counting = $count-1; if( $this->ipsclass->DB->get_num_rows($numresults) == 0 ){ $playlist .= $this->ipsclass->compiled_templates['skin_player']->filepl_no_info(); } else { while($row = $this->ipsclass->DB->fetch_row($result)){ $row['path'] = $this->base_url . "autocom=player&do=display§ion=playlist&"; $counting++; $playlist .= $this->ipsclass->compiled_templates['skin_player']->music(array( "id" => $row['id'], "name" => $row['name'], "path" => $row['path']), $counting ); } } $buildnav .= $this->ipsclass->compiled_templates['skin_player']->list_playlistnav($tmps); //------------------------------------------------------ // Outputs //------------------------------------------------------ $buildoutput = $this->ipsclass->compiled_templates['skin_player']->show_playlist($playlist, $buildnav); $this->ipsclass->print->pop_up_window( "Your mini playlist" , $buildoutput ); } [My Mod Source for IPB 3] private function miniplaylist( ) { $limit=5; $this->input['page'] ? $page = intval($this->input['page']) : $page=0; if ($limit < 1) {$limit=1;} if ($page < 0) {$page=0;} $getresults = array(); $this->DB->build( array( 'select' => '*', 'from' => 'nmplaylist', 'where' => 'mid= '. intval( $this->memberData[ 'member_id' ] ), 'order' => 'name ASC')); $this->DB->execute(); $numrows = $this->DB->getTotalRows(); $pages = ceil($numrows/$limit); // Number of results pages. $numrows .= " LIMIT $page,$limit"; $result = $getresults; $count = $page + 1; $ncount = 0; $ncount++; if ($pages < 1){ $total = 1;} // If $pages is less than one , total pages is 1. else { $total = $pages;} // Else total pages is $pages value. $first = $page + 1; // The first result. if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) { $last = $page + $limit;} //If not last results page, last result equals $page plus $limit. else{ $last = $numrows;} // If last results page, last result equals total number of results. $current = intval($page/$limit) + 1; // Current page number. // calculate number of pages needing links $pages= intval($numrows/$limit); if ($numrows%$limit) { // has remainder so add one page $pages++; } $more = true; $less = true; $back_page = $page - $limit; if ($back_page < 0) { $back_page = 0;} if ($page!=0) { $tmps = "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$back_page}'><< previous</a> - "; } $limitnum = 5*$limit; for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page) { $tmps .= "[<b>$i</b>] "; // Current page doesn't need a link, just text. } elseif ($ppage < $page - $limitnum){ if ($less){$tmps .= " ... ";}; $less = false; } elseif ($ppage > $page + $limitnum){ if ($more){$tmps .= " ... ";}; $more = false; } else{ $tmps .= "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page=$ppage'>$i</a> "; } } if(($current) <= ($total-7)){ $tmps .= "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page=".$ppage."'>$total</a> "; } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { $next_page = $page + $limit; $tmps .= " - <a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$next_page}'>next >></a> "; } $counting = $count-1; if( $this->DB->getTotalRows($numresults) == 0 ){ $playlist .= $this->registry->output->getTemplate('playersystem')->filepl_no_info(); } else { while($row = $this->DB->fetch()){ $getresults[] = $row; $row['path'] = $this->base_url . "autocom=player&do=display§ion=playlist&"; $counting++; $playlist .= $this->registry->output->getTemplate('playersystem')->music(array( "id" => $row['id'], "name" => $row['name'], "path" => $row['path']), $counting ); } } $buildnav .= $this->registry->output->getTemplate('playersystem')->list_playlistnav($tmps); //------------------------------------------------------ // Outputs //------------------------------------------------------ $none = ""; $css = ""; $jsLoaderItems = ""; $title = "Your mini playlist"; $output = $this->registry->output->getTemplate( 'playersystem' )->show_playlist($playlist, $buildnav); $this->registry->output->getTemplate('global_other')->displayPopUpWindow( $none, $title, $output); }
Ryan11433 Posted August 23, 2011 Author Posted August 23, 2011 I won't learn when you do not help me with this even reading documentations does not help at all or am I missing something? I want to know why the data from fields are not parsing to the templates.
Connor T Posted August 23, 2011 Posted August 23, 2011 This is a large post. Its a workday. Whoever chooses to help you might have to put 10+ minutes into this. Most of us during the work week don't have the time, and then when we do we spend it with family, friends and what not. Posting links to this topic in other forums also looks desperate. There are plenty of people waiting for help to various things here. Just wait patiently.
Ryan11433 Posted August 24, 2011 Author Posted August 24, 2011 Three things to question back to you... This is a large post. Its a workday. Hello I just gave you the a whole function of my hard work since 2004 instead of just a query to figure out why the data is not parsing to the template and you did not read my question. That is why you did not find out this soon. Posting links to this topic in other forums Excuse me? That was just one other forum when not knowing the correction forum to post this topic.Just wait patiently. Who is not being patient? you just want to brag to make me upset so you can think you are so cool? how cool is that? Ephesians 4:29 Do not let any unwholesome talk come out of your mouths, but only what is helpful for building others up according to their needs, that it may benefit those who listen.
Midnight Modding Posted August 26, 2011 Posted August 26, 2011 [My Mod Source for IPB 3]private function miniplaylist( ) { $limit=5; $this->input['page'] ? $page = intval($this->input['page']) : $page=0; if ($limit < 1) {$limit=1;} if ($page < 0) {$page=0;} $getresults = array(); $this->DB->build( array( 'select' => '*', 'from' => 'nmplaylist', 'where' => 'mid= '. intval( $this->memberData[ 'member_id' ] ), 'order' => 'name ASC')); $this->DB->execute(); $numrows = $this->DB->getTotalRows(); $pages = ceil($numrows/$limit); // Number of results pages. $numrows .= " LIMIT $page,$limit"; $result = $getresults; $count = $page + 1; $ncount = 0; $ncount++; if ($pages < 1){ $total = 1;} // If $pages is less than one , total pages is 1. else { $total = $pages;} // Else total pages is $pages value. $first = $page + 1; // The first result. if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) { $last = $page + $limit;} //If not last results page, last result equals $page plus $limit. else{ $last = $numrows;} // If last results page, last result equals total number of results. $current = intval($page/$limit) + 1; // Current page number. // calculate number of pages needing links $pages= intval($numrows/$limit); if ($numrows%$limit) { // has remainder so add one page $pages++; } $more = true; $less = true; $back_page = $page - $limit; if ($back_page < 0) { $back_page = 0;} if ($page!=0) { $tmps = "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$back_page}'><< previous</a> - "; } $limitnum = 5*$limit; for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page) { $tmps .= "[<b>$i</b>] "; // Current page doesn't need a link, just text. } elseif ($ppage < $page - $limitnum){ if ($less){$tmps .= " ... ";}; $less = false; } elseif ($ppage > $page + $limitnum){ if ($more){$tmps .= " ... ";}; $more = false; } else{ $tmps .= "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page=$ppage'>$i</a> "; } } if(($current) <= ($total-7)){ $tmps .= "<a href='$PHP_SELF?autocom=player&do=miniplaylist&page=".$ppage."'>$total</a> "; } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { $next_page = $page + $limit; $tmps .= " - <a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$next_page}'>next >></a> "; } $counting = $count-1; if( $this->DB->getTotalRows($numresults) == 0 ){ $playlist .= $this->registry->output->getTemplate('playersystem')->filepl_no_info(); } else { while($row = $this->DB->fetch()){ $getresults[] = $row; $row['path'] = $this->base_url . "autocom=player&do=display§ion=playlist&"; $counting++; $playlist .= $this->registry->output->getTemplate('playersystem')->music(array( "id" => $row['id'], "name" => $row['name'], "path" => $row['path']), $counting ); } } $buildnav .= $this->registry->output->getTemplate('playersystem')->list_playlistnav($tmps); //------------------------------------------------------ // Outputs //------------------------------------------------------ $none = ""; $css = ""; $jsLoaderItems = ""; $title = "Your mini playlist"; $output = $this->registry->output->getTemplate( 'playersystem' )->show_playlist($playlist, $buildnav); $this->registry->output->getTemplate('global_other')->displayPopUpWindow( $none, $title, $output); } $this->input needs to be $this->request and autocom needs to be app. May still be the wrong urls thoughif base_url is formatted differently now I forget.
Ryan11433 Posted August 26, 2011 Author Posted August 26, 2011 $this->input needs to be $this->request and autocom needs to be app. May still be the wrong urls thoughif base_url is formatted differently now I forget. that's it? do you think that is the problem why the data is not being parsed from the database or the template? I didn't think so but thank you for another fixes. Is there anyone can help?
Midnight Modding Posted August 27, 2011 Posted August 27, 2011 What's it doing? Is it showing some data, but not formatted how you want it? Or it's not showing anything at all?
Ryan11433 Posted August 27, 2011 Author Posted August 27, 2011 What's it doing? Is it showing some data, but not formatted how you want it? Or it's not showing anything at all? it is not showing data at all and a working mod preview is at http://forums.hiphop...st&attach_id=55 as it was using IPB 2.3.6. I did make the modification to work on IPB long time ago and am trying to get it to work again in IPB 3.2 The site I'm working on is at http://forums.hiphop...pp=playersystem using IPB 3.2 copy. I hope someone like you could figure out why the data is not parsing at all.
Ryan11433 Posted August 28, 2011 Author Posted August 28, 2011 Sorry I forgot to meant that the Personal Playlist is showing nothing except my copyright string and that is under miniplaylist function with the source I provided with some fixes. It is still not showing the data that is supposed to gather from my database.
Ryan11433 Posted August 28, 2011 Author Posted August 28, 2011 Wait.. this is really strange I just finished converting two control panel section and they are working.. I guess I need to go back running mysql query and IPB query. It is working again and do you know anything about $this->registry->output->getTemplate('global_other')->displayPopUpWindow because it prints out the whole IPB page as you see at http://forums.hiphopselite.com/beta/Index.php?app=playersystem in frames.
Midnight Modding Posted August 29, 2011 Posted August 29, 2011 If nothing shows maybe you didn't have it print the outpuit. For the other issue I'm not sure. It must be soemthing about that specific template which I ahvent used before.
Ryan11433 Posted August 30, 2011 Author Posted August 30, 2011 thats true i had to switch it to use query instead of build array too however to call $this->registry->output->getTemplate('global_other')->displayPopUpWindow prints out the whole IPB page instead of just the html from assigned template is there a way to stop the whole IPB printing out?
Midnight Modding Posted August 30, 2011 Posted August 30, 2011 I haven't used it before, so not sure. Maybe would have to make a new template bit and take out what you don't need.
Royzee Posted August 30, 2011 Posted August 30, 2011 $this->registry->output->getTemplate('global_other')->displayPopUpWindow( $none, $title, $output); If your using your 2.3.6 template html, it may be calling on javascript code that doesn't exist in 3.2.Using the javascript popup class.
Ryan11433 Posted August 30, 2011 Author Posted August 30, 2011 yeah but from IPB 2.3.6 it was$this->ipsclass->print->pop_up_window( $title , $buildoutput ); What javascript is missing to stop the whole IPB page to display in the pop up window? and in Using the javascript popup class link is a tutorial so I'll read about it thank you
Ryan11433 Posted September 1, 2011 Author Posted September 1, 2011 May still be the wrong urls thoughif base_url is formatted differently now I forget. $this->base_url = $this->settings['board_url']."/index.php?"; and that should work then ;)$this->registry->output->getTemplate('global_other')->displayPopUpWindow( $none, $title, $output); If your using your 2.3.6 template html, it may be calling on javascript code that doesn't exist in 3.2.Using the javascript popup class. I did try this but it still is printing out the whole IPB page? Am I missing something?
Royzee Posted September 1, 2011 Posted September 1, 2011 It looks like your throwing a lot into the page with...$tmps .= " - <a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$next_page}'>next >></a> "; You might want to do a var_dump($tmps); after the above line and see what is in it, or check a few other vars. You also have an extra ">" near the end, but doubt it is causing any harm. **Debugging is anticipated with distaste, performed with reluctance, and bragged about forever.**
Ryan11433 Posted September 1, 2011 Author Posted September 1, 2011 It looks like your throwing a lot into the page with...$tmps .= " - <a href='$PHP_SELF?autocom=player&do=miniplaylist&page={$next_page}'>next >></a> ";[/CODE] You might want to do a var_dump($tmps); after the above line and see what is in it, or check a few other vars. You also have an extra ">" near the end, but doubt it is causing any harm. **Debugging is anticipated with distaste, performed with reluctance, and bragged about forever.** /*-----------------------------------------------------*/ // View Mini Playlist //-----------------------------------------------------*/ private function miniplaylist( ) { $limit=5; $this->request['page'] ? $page = intval($this->request['page']) : $page=0; if ($limit < 1) {$limit=1;} if ($page < 0) {$page=0;} $query = "SELECT * FROM ibf_nmplaylist WHERE mid = '". $this->memberData[ 'member_id' ] ."' ORDER BY name ASC"; $this->DB->query("SELECT * FROM ibf_nmplaylist WHERE mid = '". $this->memberData[ 'member_id' ] ."' ORDER BY name ASC"); $numresults=mysql_query($query); $numrows = $this->DB->getTotalRows($numresults); $pages = ceil($numrows/$limit); // Number of results pages. $query .= " LIMIT $page,$limit"; $result = mysql_query($query); $count = $page + 1; $ncount = 0; $ncount++; if ($pages < 1){ $total = 1;} // If $pages is less than one , total pages is 1. else { $total = $pages;} // Else total pages is $pages value. $first = $page + 1; // The first result. if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) { $last = $page + $limit;} //If not last results page, last result equals $page plus $limit. else{ $last = $numrows;} // If last results page, last result equals total number of results. $current = intval($page/$limit) + 1; // Current page number. // calculate number of pages needing links $pages= intval($numrows/$limit); if ($numrows%$limit) { // has remainder so add one page $pages++; } $more = true; $less = true; $back_page = $page - $limit; if ($back_page < 0) { $back_page = 0;} if ($page!=0) { $tmps = "<a href='$PHP_SELF?app=playersystem&do=miniplaylist&page={$back_page}'><< previous</a> - "; } $limitnum = 5*$limit; for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page) { $tmps .= "[<b>$i</b>] "; // Current page doesn't need a link, just text. } elseif ($ppage < $page - $limitnum){ if ($less){$tmps .= " ... ";}; $less = false; } elseif ($ppage > $page + $limitnum){ if ($more){$tmps .= " ... ";}; $more = false; } else{ $tmps .= "<a href='$PHP_SELF?app=playersystem&do=miniplaylist&page=$ppage'>$i</a> "; } } if(($current) <= ($total-7)){ $tmps .= "<a href='$PHP_SELF?app=playersystem&do=miniplaylist&page=".$ppage."'>$total</a> "; } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { $next_page = $page + $limit; $tmps .= " - <a href='$PHP_SELF?app=playersystem&do=miniplaylist&page={$next_page}'>next >></a> "; } $counting = $count-1; if( $this->DB->getTotalRows($numresults) == 0 ){ $this->output .= $this->registry->output->getTemplate('playersystem')->filepl_no_info(); } else { while($row1 = $this->DB->fetch($result)){ $row1['path'] = $this->base_url . "app=playersystem&do=display§ion=playlist&"; $counting++; $this->output .= $this->registry->output->getTemplate('playersystem')->music(array( "id" => $row1['id'], "name" => $row1['name'], "path" => $row1['path']), $counting ); } } $buildnav = $this->registry->output->addContent($this->registry->output->getTemplate('playersystem')->list_playlistnav($tmps)); //------------------------------------------------------ // Outputs //------------------------------------------------------ $buildoutput = $this->registry->output->addContent($this->registry->output->getTemplate( 'playersystem' )->show_playlist($playlist, $buildnav)); $this->registry->output->setTitle( $this->settings['board_name'] . " -> Your mini playlist" ); $this->output .= $this->registry->output->getTemplate('global_other')->displayPopUpWindow( $none, $type , $buildoutput ); } The reply to underlined about next >>? that is the text. Also these my latest source for that function listed below for IPB 3.2.2.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.