himself0890
Forum Replies Created
-
Forum: Plugins
In reply to: Query PostsI tried 4 trailing slashes and I’ve tried 3 trailing slashes and so on, and I get this message:
Warning: include(../../../../wp-settings.php) [function.include]: failed to open stream: No such file or directory in /www/sites/site-dir/files/html/wp-content/plugins/myplugin/mypluginfile.php on line 11 Warning: include() [function.include]: Failed opening '../../../../wp-settings.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /www/sites/site-dir/files/html/wp-content/plugins/myplugin/mypluginfile.php on line 11
??
EDIT:
I deactivated the actual plugin and put this include in the file:
include '../../../wp-settings.php';
But I get this error when requesting that file:
<br /> <b>Warning</b>: require(ABSPATHwp-includes/compat.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/www/sites/site-dir/files/html/wp-settings.php</b> on line <b>246</b><br />
Forum: Plugins
In reply to: Query PostsDo you happen to know what the actual include code would be?
I don’t want it to sound like I want you to do it for me, but I have tried to include files and couldn’t get the right directory.i.e. How many ‘../’ should I use to get to the settings file..
Forum: Plugins
In reply to: Query PostsYes, it comes up in WP-Admin->Plugins.
Right now, it is in:
wp-content/ --plugins/ ----mypluginname/ ------mypluginname.php
Unfortunately, I have to use prototype for this script..
There is a button on the page “More Stories” with the id=”MoreStories”.var more_offset = 6; $('MoreStories').observe('click', function() { var moreAjax = new Ajax.Request('https://mysite.com/wp-content/plugins/myplugin/mypluginname.php?offset=' + more_offset, { method: 'get', onCreate: function() { $('NewsStories_Container').setStyle({'background':'url(https://mysite.com/path/to/theme/images/ajaxloading.gif) bottom left no-repeat'}); }, onComplete: function(oReq) { $('NewsStories_Container').setStyle({'background':'none'}); var data = oReq.responseText; if (data != 'finished') { if (data.substr(-8, 8) == 'finished') { data = data.slice(0, -8); $('MoreStories').fade({queue: 'end'}); } $('NewsStories_Container').innerHTML += "<ul id='more"+more_offset+"' class='newslist' style='display:none'>" + data + "</ul>"; $('more'+more_offset).appear({queue: 'end'}); more_offset += 5; } else { $('MoreStories').hide(); } } }); });
The way the previous programmer used a Template, I changed the Ajax.Request() url from his template to my plugin though. His template handled this script:
query_posts('showposts=5&caller_get_posts=1&offset='.$_GET['offset']); $count = 1; if (have_posts()) : while (have_posts()) : the_post(); $categories = get_the_category(); $category = $categories[0]; foreach($categories as $cat) { if ($cat->parent != 0) $category = $cat; } $showurl = get_bloginfo('url')."/".get_the_time('Y')."/show-news/".the_slug(); ?> <li> <h2><a href="<?=$showurl?>" title="<?php the_title(); ?>"><?php the_title() ?></a></h2> <span class="PostInfo">By <?php the_author(); ?>, <?php the_time('F j, Y'); ?> in <?php the_category(', '); ?></span> <?php if ( p75HasThumbnail($post->ID) ) { $dimensions = getimagesize('/home/dir/goes/here/'.p75GetOriginalImage($post->ID)); echo "<a href='$showurl' class='radius8' style='margin: 0 5px 5px 20px; float: left; clear: left; display: block; width: 145px; height: ".(floor(145*$dimensions[1]/$dimensions[0]))."px; background: url(".p75GetThumbnail($post->ID, 145).") no-repeat top left;'> </a>"; } ?> <?php the_advanced_excerpt('length=190&use_words=0') ?> <a class="readmore" href="<?=$showurl?>" title="<?php the_title(); ?>" >Read More</a> <div class="bottomfade"><span class="left"> </span><span class="right"> </span><span class="mid"> </span></div> </li> <?php if( (($wp_query->current_post + 1) == ($wp_query->post_count)) && $count != 5) echo 'finished'; $count++; endwhile; else: { echo 'finished'; } endif;
Forum: Plugins
In reply to: Query PostsYes, it is in <mypluginname> folder.. You’re saying it needs to be in the same folder as ‘hello.php’?