Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How would you go around this?
Dragan, I am not sure of the versions you want are on Michael’s site yet. I think you will have to wait a little bit longer. Once they are released and working as expected on my site, I will post some code examples for others to use.
Offline
Re: How would you go around this?
OK, I got the plugin to work (sort of) – i.e. it outputs the default fields from the mod_article_form, but it doesn’t output the submit button, it’s just an empty div. Does the plugin require the user submitting the article to exist as a txp user in the DB? Does mem_moderation_article require mem_self_register?
I just read in the plugin’s thread that jstubbs you are using MAMP as well and you were suspicious of it’s cookies settings, could that be my problem?
All I need is this: User comes to the page and sees an input field for the title, his nick (which populates custom_1), his URL and a url to an image, clicks the submit button and that’s it.
OK, I got that sorted out, I wasn’t using the mod_article_form properly, now I can submit articles, but they don’t show up in the moderation queue. Could this be a MAMP problem?
Here’s the error:
Warning: join() [function.join]: Bad arguments. in /Applications/MAMP/htdocs/bebostation/textpattern/lib/txplib_misc.php(446) : eval()'d code on line 147
Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 select id,type from txp_moderation where `id` IN () in /Applications/MAMP/htdocs/bebostation/textpattern/lib/txplib_db.php on line 84
Last edited by draganbabic (2007-12-11 19:56:47)
Offline
Re: How would you go around this?
You need mem_self_register and ign_password_protect if you want users to register/login. Not to the TXP backend – you can have a user’s page with the new versions of the mem_ plugins. Note that you need mem_admin_parse for mem_moderation plugins.
I really think you will save time and anguish if you wait for the newer versions – they are much better. But, what you are looking for will be something like this:
<txp:ign_if_logged_in>
<txp:mem_moderation_form type="article" label="Post Your Stuff" redirect="/my-page/">
<div class="submit_label">Title</div>
<txp:mem_moderation_text name="title" label="" />
</txp:mem_moderation_form>
<txp:else />
<h2>Login below</h2>
<txp:ign_show_login form="login_form" />
<h2>Or register a new account</h2>
<txp:mem_self_register_form namewarn="Name is required" userwarn="Username is required" emailwarn="Email address is required" />
</txp:ign_if_logged_in>
Offline
Re: How would you go around this?
@ Gocom – I am wondering if you can help me here (or anyone else for that matter) – your code works beautifully, but I am wondering if that URL could be cleaned up, right now I got bebostation.com/users/?user=username, I was wondering if that could become bebostation.com/users/username or something?
Offline
Re: How would you go around this?
You could ask someone .httaccess + rewrite rule special to do that thing for you. I could do it without Textpattern but I’m not so good at it that I could do it when Textpattern’s rewrites conflict with it.
You could also change the ?user
/ gps('user')
in my code to gps('q')
so then it would work with Textpattern’s search functionality. And then it could be rewrited to clean with couple simple teps. It could then also be done with gbp_permanent_links with simple rewrite rule:
/section/search/
And then allow it for section named users. Then the urls would work also with bebostation.com/users/username
. But this requires to use the q
-request that is also used for Textpattern’s search. Therefor, remember to remove all searchable staff from the content that is used for the users-section.
Cheers!
Last edited by Gocom (2008-01-14 14:21:57)
Offline
Re: How would you go around this?
Darn, I got it to work with search, so the URL is now bebostation.com/users/?q=username, but when I set the redirect from GBP_permanent_links like you told me – I get a blank page, any Idea what’s going on? Here’s the code of my page template:
<txp:output_form form="head" />
<txp:output_form form="header" />
<div id="content">
<txp:output_form form="secondary" />
<div id="primary">
<div class="mainBlock">
<txp:php> if(gps('q')) {echo '<h2>'.gps('q').'’s Skins</h2>';} </txp:php>
</div>
<txp:output_form form="googleSearch" />
<ul id="mainGallery">
<txp:asy_wondertag><txp:article_custom limit="9999" section="skins" form="default" created_by="<txp:php>echo gps('q');</txp:php>" /></txp:asy_wondertag>
</ul>
</div><!--end #primary -->
<txp:output_form form="tertiary" />
</div><!--end #content -->
</div><!--end #container -->
<txp:output_form form="footer" />
Offline
Re: How would you go around this?
draganbabic, this should work:
<txp:output_form form="head" />
<txp:output_form form="header" />
<div id="content">
<txp:output_form form="secondary" />
<div id="primary">
<div class="mainBlock">
<txp:if_search><h2><txp:q />’s Skins</h2></txp:if_search>
</div>
<txp:output_form form="googleSearch" />
<ul id="mainGallery">
<txp:asy_wondertag><txp:article_custom limit="9999" section="skins" form="default" created_by="<txp:q />" /></txp:asy_wondertag>
</ul>
</div>
<txp:output_form form="tertiary" />
</div>
</div>
<txp:output_form form="footer" />
Remember that <txp:q />
is deprecated txp-tag but it works, so if it returns errors don’t worry about them. I use that with gbp_permanent_links for searches and other and it works just fine.
Cheers!
Offline
Re: How would you go around this?
Hi Gocom, this works with gbp_permanent links, but however- it does not output the title now so I had to remove the if_search conditional.
Now this gpb_permanent_links this brought on a new problem – it wrecks this tag that I am using to display categories :(
<txp:category_list section="skins" wraptag="ul" break="li" />
It just defaults all category links to http://bebostation.com/skins and it is present only when the redirect rule is active, as soon as I delete it – it goes back to normal, even if I have limited it to a specific section. An thoughts on that?
There is one more thing I am wondering if it is possible to do – when a skin is added to the site as an article – a custom field is populated called bebo_user_ID that contains the bebo.com user profile of that user. Is it possible to pull that custom field’s value out on the page when viewing that user’s skins? For example – we are viewing user Jim’s skins, and all articles that are created by the user Jim have the same value in that bebo_user_ID filled in. Don’t know if that’s all that smart, but I couldn’t think of a better way to do it. Maybe there is a better way around it? Thanks.
Offline
Re: How would you go around this?
Draganbabic. Yeah, gbp_permanent_links has some issues, like it sometimes screws category lists, section list and pagination links that are output by the default core tags. The wonder is that it happens only sometimes, not always. You could aks gbp to do something to that issue. But it’s some sort of conflict with Textpattern’s rewrite rules – so the fix is quite impossible – even for Mr. Possible.
BTW, bebostation.com is awesome looking – and also works great. I love it completely. It’s so beautiful.
Cheers!
Last edited by Gocom (2008-01-22 04:09:51)
Offline
Re: How would you go around this?
Hi Gocom, and thanks for the nice words about bebostation. This is the second version of the design – I personally liked the first one better, but with this the accent was to up the CTRs on ads, so they are a little bit “in your face”, but that’s the way the client wanted it. Also thanks so much for all your help with my questions. Now if I could just find a way to go around this category listing problem…
Offline
Re: How would you go around this?
draganbabic,
You could handcode them with article_custom, if_different and category1. Another way is do some php magic. In example you could remove that /users/
with php or you could set up new gbp_permanent_links rewrite rule for categories.
In example / category /. Then also categories would be clean. Set that only for default section or categories. Then the category links could or should be fine. If not then you would need to do some php-magic:
$remove = '/skins/?c=';
$where = category_list(array(
'type' => 'article',
'sort' => 'title',
));
$final = strtr($where, $remove, '');
echo $final;
Change the attributes to fit your needs. If you don’t use gbp_permanent_links’ rewrite rule for categories, then the $remove
should be /skins
.
Cheers!
Offline