Unpinnable message?
|
Posted
#77205
(In Topic #15890)
|
|
|---|---|
|
Fan in action |
Next question. we have a Gallery. It was so popular that I clicked 'allow users to have their own personal galleries.' And now we have a lot of personal galleries, for each user on the site. Excellent. But those users are posting about 20 new pictures a day, and Validating them is taking a lot of time. I know that each gallery has its own permissions, like each forum does, but, to get the pictures to auto-validate, I'd have to edit every personal gallery's permissions. That would take all day, or more. And then what about new users that create new galleries? So, my question…how can I Mass-validate the incoming pictures in personal galleries? Also, how do I Mass-Change the permissions to all the personal galleries at once, and for the future, so that all new picture submissions are auto-validated? Thanks for any suggestions, all. Amazing software. |
|
Posted
|
|
|
ocStaff (admin) |
Regarding pin permissions, please attach screenshots from the edit forum screen of the forum and it's subforum, so we can verify the permissions really are the same. Looks like an odd one to me. Regarding the gallery perms, I think probably each gallery has default permissions. i.e. does not override them. If that's the case you can just set what you need on the galleries module itself (using the Permission Tree Editor). Then it will automatically cascade. Regarding validating things you already have, you'll need to do a query in OcCLE: Code
:$GLOBALS['SITE_DB']->query_update('images',array('validated'=>1));
If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
|
Posted
|
|
|
Fan in action |
Code
http://www.example.com/cms/index.php?page=cms_galleries&type=ad&cat=member_2_root
That tells OCPortal which Gallery we are going to upload to. But what if the user is not logged in? I tried this Code
http://www.example.com/cms/index.php?page=cms_galleries&type=ad
But OCPortal doesn't stop you and ask you to log in. Neither will it let you upload a picture, of course, because there is no valid Gallery in the url. So I'm looking for a way to link that icon to a url that might say "login first" if it's a guest, or carry the correct member number if it's a logged in user. Alternately, maybe some comcode that will Not print the box on the page If it's not a logged in user. There are 2 comcode's similar, but they don't look at the user status, that i can see. Any ideas? |
|
Posted
|
|
|
Community saint |
Bob |
|
Posted
|
|
|
Fan in action |
I worry that I'm leaving out a group in my if-in-group tag (0 or 1) unnecessarily. So what is group 0 and 1? Anyone know for sure? |
|
Posted
|
|
|
Community saint |
Bob |
|
Posted
|
|
|
Fan in action |
Code
<?php
That code works well, but only in a miniblock, so far. I tried to get it to work inside the main website's page, but it won't go for it. It seems to want to, because it transforms the php into something else. But maybe it's just choking on it…I'm not sure. What I want to do is something like this: Code
<?php
But I can't figure out how to embed php among the other comcodes and blocks that make up the main from page of the site. Any idea how to do that? |
|
Posted
|
|
|
ocStaff (admin) |
If you need to pass things in, it's easy. Let's say your miniblock is foo.php and you do… [block whatever="this"]foo[/block] From the PHP code you have access to the parameter via $map['whatever']; (it's magically defined for you) If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
|
Posted
|
|
|
Fan in action |
[codeblock]{$USERNAME} and {$USER}[/codeblock] But that actually doesn't work in quotes. And escaping it with a * or any of the others didn't work, either. However, those codes outside quotes seemed to work. Is there a way to get those to work inside something like [codeblock] <a href="http://www.example.com/cms/index.php?page=cms_galleries&type=ad&cat=member_{$USER}_root">link test</a>[/codeblock]That would be such a simple solution for so many links PS Bob, Found out Guest group = 1, Admin group = 0 |
|
Posted
|
|
|
Community saint |
Bob |
|
Posted
|
|
|
ocStaff (admin) |
If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
|
Posted
|
|
|
Fan in action |
o) However, there is quite a lag in sending messages out to a chat room. How can I speed that up by…a lot. Thanks you for your patience! |
|
Posted
|
|
|
ocStaff (admin) |
If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
|
Posted
|
|
|
Fan in action |
New issue: Few hours ago a guy created a new account and went on a spam-fest. I can fix everything except the ability for a new user to email other members. I looked in the site-tree-editor, but didn't see an option to prevent newbies from sending emails to other users. How can I do that, other than remove the option from the whole page? |
|
Posted
|
|
|
ocStaff (admin) |
If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
|
Posted
|
|
|
Fan in action |
Unfortunately a query has failed [SELECT t1.*,t2.q_member,t3.q_answer_text FROM ocpo_quiz_entry_answer t1,ocpo_quiz_entries t2,ocpo_quiz_question_answers as t3 WHERE t2.id=t1.q_entry AND t1.q_answer=t3.id AND t2.q_quiz=blah-competency-test ORDER BY q_order] [Unknown column 'blah' in 'where clause'] … The url for the quiz is very similar to this: Code
http://www.witcheschat.com/index.php?page=quiz&type=do&id=blah-competency-test
So I tried to use occle to discover the table and column names, but actually this doesn't work: Code
:$GLOBALS['SITE_DB']->show tables;
Neither does this: Code
:$GLOBALS['SITE_DB']->select * from ocpo_quiz_question_answers;
So I'm trying to access the quizzes data so that I can auto-add a member to a usergroup If they pass a particular quiz. Where I'll actually do this is yet to be determined, but first I have to access the data, or more specifically, the members that have "passed" the particular quiz. My miniblock code that does not yet work is called from a test page, passing "id" correctly, but errors out: Code
<?php
Any ideas about finding out the id of the quiz? |
|
Posted
|
|
|
Community saint |
This error is caused by mission single quotes, i.e.: …AND t2.q_quiz='blah-competency-test' ORDER…
Visit Last Gamer because its made with ocPortal.
Stay for the content - Video game retrospectives, reviews, galleries and discussions. Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio . |
|
Posted
|
|
|
ocStaff (admin) |
To execute a query in ocPortal, using ocPortal's API, and PHP's syntax… Code
$result=$GLOBALS['SITE_DB']->query('SQL GOES HERE');
Code
:var_dump($GLOBALS['SITE_DB']->query('show tables'));
Regarding the codes in the URL, they're not the IDs, they're "monikers" (url_monikers table defines them). They're generated from name/title/whatever-the-content-type-has, and they map to the ID numbers in the rows. It's for SEO/nice-URLs. If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
|
Posted
|
|
|
Fan in action |
Code
[block group_name="Computer Nerds"]add_quizz_passer_to_usergroup[/block]
And I added it to the text field of the quiz that is displayed if the member passes the quiz. add_quizz_passer_to_usergroup.php is the miniblock and looks like this: Code
<?php
When the member passes the quiz, the miniblock is executed and the member is entered into the usergroup immediately. So if someone wants to admit members to usergroups automatically, this code might help a bit. If your block contains an incorrect usergroup name, it will error out and give you the trace. Same error will happen if it's an invalid user, or if for any other reason the query from the database didn't return something we can use. This code only has one bothersome issue. The database call references t0.text_original when it should reference g_name or even g_title. But I can't get g_name to work there. perhaps it's yet part of a bigger object that needs dereferencing or something. I dunno. Nor do I know for sure what t0.text_original is. But it does work LOL! Anyone with insight as to how to use g_name in that call instead of t0.text_original? Thanks Chris. |
1 guests and 0 members have just viewed this: None
Control functions:







