_OMEGA_
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: PHPBB Single Sign On] Can’t Auth Mode – Option Selected Doesn’t SaveI did these changes and it seems work.
In the phpbb-single-sign-on common.php file:
CHANGE
$include_common_contents = include_for_eval($phpbb_root_path . 'common.orig.' . $phpEx);TO
$include_common_contents = include_for_eval($phpbb_root_path . 'common-orig.' . $phpEx);MODIFY the name of the original common.php:
FROMcommon.orig.php
TO
common-orig.php
Forum: Plugins
In reply to: [Plugin: PHPBB Single Sign On] Can’t Auth Mode – Option Selected Doesn’t SaveAnyone fixed these two errors:
Warning: file_get_contents(./common.orig.php) [function.file-get-contents]: failed to open stream: No such file or directory in httpdocs/forum/common.php on line 17
Fatal error: Call to a member function session_begin() on a non-object in httpdocs/forum/index.php on line 24
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageSolved!
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageOk ok I’ve fixed the page with the code, but….. 🙂
Another problem.In the “Displayed page” I have this code:
function display() { $my_hostname = "localhost"; $my_db_user = "*******"; $my_db_password = "*********"; $my_database = "**********"; $wpdbtest_otherdb = new wpdb($my_db_user, $my_db_password, $my_database, $my_hostname); if(isset($_GET['id_nation'])) { $id_nation=mysql_real_escape_string($_GET['id_nation']); $myresults = $wpdbtest_otherdb->get_results("SELECT * FROM MyTable WHERE id_nation = '".$id_nation."' ORDER BY id_name ASC"); foreach ($myresults as $myresult) { ?> <table width="500px" height="145px"> <tr> <td>$myresult->id_category</td> <td>$myresult->id_name</td> </tr> </table> <? } } ?>Now I want to add the pagination here, but now the problem appears.
This is the working code that I use in the other page:$page_name="admin.php?page=myprivatepage/paged.php"; $start=$_GET['start']; if(strlen($start) > 0 and !is_numeric($start)){ echo "Data Error"; exit; } $eu = ($start - 0); $limit = 2; // No of records to be shown per page by default. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2=" SELECT * FROM MyTable "; $result2=mysql_query($query2); echo mysql_error(); $nume=mysql_num_rows($result2); /////// The variable nume above will store the total number of records in the table//// /////////// Now let us print the table headers //////////////// $bgcolor="#f1f1f1"; echo "<p><TABLE width=90% align=center border=1> <tr>"; echo "<td align='center' style='background-color: #ffcc66; color: #990000; width: 250px; text-align: center; font-weight: 700'>Image</td>"; echo "<td align='center' style='background-color: #ffcc66; color: #990000; width: 250px; text-align: center; font-weight: 700'>Name</td>"; echo "</tr>"; ////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page/////////// $query=" SELECT * FROM MyTable ORDER BY id_col_date DESC limit $eu, $limit "; $result=mysql_query($query); echo mysql_error(); //////////////// Now we will display the returned records in side the rows of the table///////// while($protot = mysql_fetch_array($result)) { if($bgcolor=='#f1f1f1'){ $bgcolor='#ffffff'; } else { $bgcolor='#f1f1f1'; } echo "<tr >"; echo "<td>$protot[id_image]</td>"; echo "<td>$protot[id_name]</td>"; echo "</tr>"; } echo "</table>"; ////////////////////////////// End of displaying the table with records //////////////////////// /////////////// Start the buttom links with Prev and next link with page numbers ///////////////// echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0) { print "<a href='$page_name&start=$back&limit=$limit'><font face='Verdana' size='2'>PREV</font></a>"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo "</td><td align=center width='30%'>"; $i=0; $l=1; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ echo " <a href='$page_name&start=$i&limit=$limit'><font face='Verdana' size='2'>$l</font></a> "; } else { echo "<font face='Verdana' size='4' color=red>$l</font>"; } /// Current page is not displayed as link and given font color red $l=$l+1; } echo "</td><td align='right' width='30%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume) { print "<a href='$page_name&start=$next&limit=$limit'><font face='Verdana' size='2'>NEXT</font></a>"; } echo "</td></tr></table>";Unfortunatelly I don’t be able to add the code above on the one of the “Displayed page” preserving the code, just adding this one!
Any hint as usual? 😀
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageHey back with news….good news 🙂
Used the code of the 6th post, modified a lot of parts of it and now finally everything works great.
Thank you for the chatty and for the hints that helped me to think and fix my problem 🙂
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageOh cool for the last hint, really helpful.
I feel a little guilty with you, cause I’m wasting your time 🙁I’ve changed the URL in this way:
$page_name="admin.php?page=last-adds"; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ echo " <a href='$page_name&paged=$i'><font face='Verdana' size='2'>$l</font></a> "; } else { echo "<font face='Verdana' size='4' color=red>$l</font>"; } /// Current page is not displayed as link and given font color red $l=$l+1; } echo "</td><td align='right' width='30%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume) { print "<a href='$page_name&paged=$next'><font face='Verdana' size='2'>NEXT</font></a>";} echo "</td></tr></table>"; }// end of if checking sufficient records are there to display bottom navigational link.And when I press the ‘Next’ or ‘2’button I’ve noticed that the URL is changed to:
http://127.0.0.1:8181/wordpress/wp-admin/admin.php?page=last-adds&paged=2
but it displays the first page with some results, it doesn’t really change the page.
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageYou right x2, but usually:
1. what I write is only for me 🙂
2. when I write and test some code I’m lost in thoughts 😛Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageBack 😛
I’m working on this code:<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000"> <? $my_hostname = "localhost"; $my_db_user = "*******"; $my_db_password = "*********"; $my_database = "**********"; $wpdbtest_otherdb = new wpdb($my_db_user, $my_db_password, $my_database, $my_hostname); $page_name="page-admin.php"; // If you use this code with a different page ( or file ) name then change this $start=$_GET['start']; if(strlen($start) > 0 and !is_numeric($start)){ echo "Data Error"; exit; } $eu = ($start - 0); $limit = 2; // No of records to be shown per page. $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2=" SELECT * FROM MyTable "; $result2=mysql_query($query2); echo mysql_error(); $nume=mysql_num_rows($result2); /////// The variable nume above will store the total number of records in the table//// /////////// Now let us print the table headers //////////////// $bgcolor="#f1f1f1"; echo "<TABLE width=50% align=center cellpadding=0 cellspacing=0> <tr>"; echo "<td bgcolor='dfdfdf' > <font face='arial,verdana,helvetica' color='#000000' size='4'>Image</font></td>"; echo "<td bgcolor='dfdfdf' > <font face='arial,verdana,helvetica' color='#000000' size='4'>Name</font></td>"; echo "<td bgcolor='dfdfdf'> <font face='arial,verdana,helvetica' color='#000000' size='4'>Category</font></td></tr>"; ////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page/////////// $query=" SELECT * FROM MyTable limit $eu, $limit "; $result=mysql_query($query); echo mysql_error(); //////////////// Now we will display the returned records in side the rows of the table///////// while($noticia = mysql_fetch_array($result)) { if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} echo "<tr >"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>$noticia[id_image]</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>$noticia[id_name]</font></td>"; echo "<td align=left bgcolor=$bgcolor id='title'> <font face='Verdana' size='2'>$noticia[id_category]</font></td>"; echo "</tr>"; } echo "</table>"; ////////////////////////////// End of displaying the table with records //////////////////////// /////////////////////////////// if($nume > $limit ){ // Let us display bottom links if sufficient records are there for paging /////////////// Start the bottom links with Prev and next link with page numbers ///////////////// echo "<table align = 'center' width='50%'><tr><td align='left' width='30%'>"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0) { print "<a href='$page_name?start=$back'><font face='Verdana' size='2'>PREV</font></a>"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo "</td><td align=center width='30%'>"; $i=0; $l=1; $self = $_SERVER['PHP_SELF']; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ echo " <a href='$page_name?paged=$i'><font face='Verdana' size='2'>$l</font></a> "; } else { echo "<font face='Verdana' size='4' color=red>$l</font>";} /// Current page is not displayed as link and given font color red $l=$l+1; } echo "</td><td align='right' width='30%'>"; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume) { print "<a href='$page_name?paged=$next'><font face='Verdana' size='2'>NEXT</font></a>"; } echo "</td></tr></table>"; }// end of if checking sufficient records are there to display bottom navigational link. ?> </body>It seems working, but when I press the ‘Next’ or the ‘2’ button I have the problem.
It seems an URL problem, my admin page where I see correctly the first page with the datas is:http://127.0.0.1:8181/wordpress/wp-admin/admin.php?page=last-adds
When I press one of the two buttons, I’m redirected to:
http://127.0.0.1:8181/wordpress/wp-admin/page-admin.php?paged=2
And wordpress says to me:
Error 404 – Not Found
Any hint?
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageThank you for the help, later I’ll test it.
but i’m not going to write it all for you… 😉
I didn’t ask this and I will not ask this! 😀
Forum: Fixing WordPress
In reply to: Page navigation buttons to the admin wordpress plugin pageI’m play with the edit.php file of the WordPress core.
1. I’ve copied/pasted it in my own plugin directory;
2. renamed it: myfile-edit.php;
Inside I’m starting to delete some code, so please don’t judge if there’s still something useless, but I’m making some tries on it.<?php /** * Edit Posts Administration Panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ if ( empty($title) ) $title = __('Last News Added'); $parent_file = 'myfile-edit.php'; wp_enqueue_script('inline-edit-post'); list($post_stati, $avail_post_stati) = wp_edit_posts_query(); require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; if ( empty($_GET['mode']) ) $mode = 'list'; else $mode = esc_attr($_GET['mode']); ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php echo esc_html( $title ); ?> <?php foreach ( $post_stati as $status => $label ) { $class = ''; if ( !in_array( $status, $avail_post_stati ) ) continue; if ( empty( $num_posts->$status ) ) continue; if ( isset($_GET['id_published']) && $status == $_GET['id_published'] ) $class = ' class="current"'; $status_links[] = "<li><a href='myfile-edit.php?id_published=$status'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>'; } //echo implode( " |</li>\n", $status_links ) . '</li>'; unset( $status_links ); ?> </ul> <?php if ( have_posts() ) { ?> <div class="tablenav"> <?php $page_links = paginate_links( array( 'base' => add_query_arg( 'paged', '%#%' ), 'format' => '', 'prev_text' => __('«'), 'next_text' => __('»'), 'total' => $wp_query->max_num_pages, 'current' => $_GET['paged'] )); ?> <?php // view filters if ( !is_singular() ) { $arc_query = "SELECT * FROM MyTable WHERE id_published = 'published' ORDER BY id_col_date DESC"; $arc_result = $wpdb->get_results( $arc_query ); $month_count = count($arc_result); echo 'Count: '.$month_count; // in MyTable I have 2 News Added, in fact I see this output -> COUNT: 2 //but in the table of the news that wordpress creates I still see the Articles entries. } } ?> </div> <?php if ( $page_links ) { ?> <div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $wp_query->query_vars['posts_per_page'] + 1 ), number_format_i18n( min( $_GET['paged'] * $wp_query->query_vars['posts_per_page'], $wp_query->found_posts ) ), number_format_i18n( $wp_query->found_posts ), $page_links ); echo $page_links_text; ?></div> <?php } ?> <div class="clear"></div> </div> <div class="clear"></div> <?php include( 'myfile-post-rows.php' ); ?> <div class="tablenav"> <?php if ( $page_links ) echo "<div class='tablenav-pages'>$page_links_text</div>"; ?> <?php inline_edit_row( 'post' ); ?> <div id="ajax-response"></div> <br class="clear" /> </div>Unfortunatelly this continues to display the Articles data, instead of the MyTable result.
Any hint??
Forum: Fixing WordPress
In reply to: Info about some code to access the DATABASEOk perfect thank you for the info 😀
I was worried that if I put there the infos all can read them in any way.Forum: Fixing WordPress
In reply to: Dropdown list & MySQL QueryHello??
Please I need help, I can fix this problem!
I don’t think that anyone can answer to this question….Forum: Fixing WordPress
In reply to: Dropdown list & MySQL QueryAny help?
Please it’s driving me crazy!!Forum: Fixing WordPress
In reply to: Dropdown list & MySQL QueryThis is my entire function that has to be:
<? function display() { global $wpdb; $wpdbtest = new wpdb('DB_USERNAME', 'DB_PASSWORD', 'DB_NAME', 'localhost'); $wpdbtest->show_errors(); ?> <form method="get"> Kind of plants:<br /> <select name="id_plants"> <option value=""></option> <option value="tree">Trees</option> <option value="shrub">Shrubs</option> <option value="bush">Bushes</option></select> <br /> <input type="submit" value="View"> </form> <?php $myplants = $wpdbtest->get_results("SELECT * FROM plants_table WHERE id_plants = '".$_GET['id_plants']."'"); foreach ($myplants as $myplant) { echo $myplant->id_category, '<br />'; echo $myplant->id_name, '<br />'; // escape from PHP ... ?> <img src="../plants/wp-content/plugins/plants_plugin/plants_images/uploads/<? echo $myplant->id_image; ?>" width="250px" height="356px""> <br /><br /> <? // starting up PHP again... } } ?>when I press the “View” button it sends me to the homepage with this address (for example if I choose Bishes):
So it doesn’t work, need help!! :'(
Forum: Fixing WordPress
In reply to: Dropdown list & MySQL QueryThank you for the code but unfortunatelly I’m going crazy to modify and apply it to my case.
Maybe I’m wrong but the code you gave me put the PHP form in every page.
I’ve created a dedicated page for the plugin and I don’t understand why if I select for example “Bushes” from the list and the address link is modified like the following:
http://mylink/mydedicatedpage/?id_plants=Bushesinstead of having the same page with the result I have the homepage.