• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

A Road to Nowhere

Create or Edit Thread.png

There are days in which coding becomes a series of starts and stops.

Create or Edit Thread
What seemed like a simple idea has turned into doubt about the need for such an option. Adding a checkbox to decide whether to create or edit a thread started out fine last week. I was able to get the meta box to show, and the option writes to the post meta table. However, retrieving the value seems too complex at the moment. Using get_post_custom_values works but ends up adding a new method named getThreadCreationCheckboxValueForPost.

$thread_checkboxes = get_post_custom_values( 'thread_checkbox', $post_id );

The work was halted as I started wondering if there was a better way to pull the meta value.

Navigation Menu
The second start and stop happened with pulling the XenForo navigation. Pulling the template is very easy for me, but optional parameters are something that I trip over.

The following code was placed within a widget and pulls the navigation, minus the CSS and without proper linking.

$dependencies = new XenForo_Dependencies_Public();

$params = $dependencies->getEffectiveContainerParams(array(),new Zend_Controller_Request_Http());
$template =$dependencies->createTemplateObject('navigation', $params);

echo $template->render();

After fussing for quite some time, I decided to ask on XenForo.com for some help. We'll see what happens.

For now -- two roads leading nowhere. It happens.
  • Like
Reactions: robru

Blog entry information

Last update

More entries in General

More entries from LPH