|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
8 i+ @) [; ]* p" x/ w5 Y// Theme Option, b7 p" ~. @. V' y" c: u- B
////////////////////////////////////////////////////////////////////////////////
" Z6 \* E+ [- z _ D) p9 b9 T# q
, g$ [6 J% ^) ^# t, G' c$themename = "Zenx";& W* b6 q) y2 @. B5 Z
$shortname = str_replace(' ', '_', strtolower($themename));5 w3 r1 p, R2 c9 m6 @6 A
: b# J l7 z* e3 ~function get_theme_option($option)
8 C8 I/ Z: L( l) f0 A; m{
& i& s9 p5 k e3 n% p global $shortname;, H7 _2 [# j8 [/ H9 p
return stripslashes(get_option($shortname . '_' . $option));
- q& K4 p: `. K; N! Q}
- b0 H, q+ R+ X/ [
4 g8 W( A) B. {9 V6 q3 g/ ufunction get_theme_settings($option)0 b0 F0 F' i# T
{
9 X) ?5 h3 w8 @9 E/ Y3 s return stripslashes(get_option($option));" V$ N8 U l/ ` c2 A" }
}
% y1 `0 b" ~" A8 J$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");" \! J& ]5 \/ Y5 ]/ l; b
$wp_getcat = array();2 x z7 p6 k$ G7 B
foreach ($wp_dropdown_rd_admin as $category_list) {; n; a! q" M: S8 L$ @& W7 d7 J8 w
$wp_getcat[$category_list->term_id] = $category_list->name;
6 j5 `) g+ g3 V3 q& ^: B}
' X0 V! n; _, b. X7 F$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
. b& `7 F2 q: z7 ?0 o' o. F$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");, C& N3 {/ R$ T: Z
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
z0 f0 n" R( F& {5 L6 P; X6 u
$ x5 |5 q% \! f0 Q" |$options = array (1 \0 }: F( N/ z9 _/ \6 ^
7 Q' d6 P+ h% v9 }" P2 V" I
/ i% ? _6 @6 N5 k; B$ H
array( "name" => "Blog Header Settings",4 |7 o5 j" @' l. B+ z
"type" => "heading",
$ x+ B& p7 T2 x% y, i# j ),( L* e9 R3 z4 T) e1 s H
* q# w% v: P* G3 p' N6 | array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 r- {) Z1 S7 }+ A2 y. a+ } "id" => $shortname."_header_logo_activate",
# p, k( \5 W9 ~ b1 w' p "type" => "select",
8 M9 K7 H! L8 V0 p, [, W "std" => "No",
' S. ~6 Z# V# O; E. B "options" => array("No", "Yes")),
( @4 R0 Y6 ]! C+ B
' l+ K2 c7 W3 { array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",8 }8 ?7 B2 |2 d8 g- z
"id" => $shortname."_logo_url",7 Z5 U/ g* j+ \0 c5 w* O$ \
"type" => "text",: h5 J P( {! r- H1 R
"box" => "social",' N; n0 U+ O1 r! t$ ^, C: S2 @
"std" => "",
1 R) m4 I7 i# f, D$ K ),+ ~4 @" O) {4 o' E8 y# t
4 _# |% d2 h$ F* c
array( "name" => "Insert Header Banner HTML Code (Header)2 W1 Y4 w u( w) v+ T
<br /><em>*Recommended Size 468 x 60</em>
; L! n% w4 I. C/ H" x) V U <br /><em>*leave blank if not use</em>",
) C8 {2 A, R0 F- @0 P "id" => $shortname."_header_banner",: P' U: v) o$ S8 |8 C$ z
"type" => "textarea",
# J; E% D9 [4 b0 C& j0 s "std" => "",- R/ F6 Y) V) m2 @; t
),
7 p! R0 x6 p1 R. U# e3 G* L7 H/ D4 E: l- p$ s4 h, P A1 z% `
array( "name" => "</div></div>",
, s9 F8 }( Z5 d "type" => "close",7 `% V. A/ K2 _0 Z
),
) h9 q T y4 F6 q- b5 E8 ]8 ?; z3 Z1 T3 `) H& O K
- R9 J) s. {8 J- { array( "name" => "Header Navigation Settings",! Z/ r; Z* _# k, ~1 }% w
"type" => "heading",
0 _+ c n1 i$ n( X5 W ),
8 C4 f0 c! T; n3 y. P, g: {3 V( O3 q; |& v4 H; N0 v: J- T) `, U7 a
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />) O: m! u3 m1 a
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />* M( L8 n8 a: J' P
<em>*Enter the page post ID number only</em><br />8 Y+ J H$ q% a
<em>*separate by comma</em><br />
) ]) J0 z9 V- s1 e3 s. t+ V p' l <em>*Exclude pages which you don't want to show on the header navigation</em>",0 d3 m' q- b$ W5 [
"id" => $shortname."_header_page_navigation",4 I7 B+ F \1 B. g/ S
"type" => "text",
7 u b2 q% C/ F$ V# ?. s "std" => "",
$ g6 C$ [$ e& J; k9 g ),
5 g7 R% `5 V7 _$ b! y- Z8 H, w! t. L+ k* r v2 [6 I& u
array( "name" => "</div></div>",( H2 g: {+ f' W; n0 n: v9 P8 V
"type" => "close",/ ]. ^8 J; `( I' o8 _
),- |/ R5 R: X1 P+ ~* \. T
' ~. N& j$ ?" j) o9 `# |
, g& Y" @& ?# L, C4 d array( "name" => "Post Auto Thumbnails Settings",
! i5 D6 R9 J- N. N' ? "type" => "heading",9 c7 w" ^& A' R, j& i0 J
),
( I$ W3 V9 s0 p8 I* m
* w7 ?: |: b4 ]* F( k$ E' N array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
0 Z0 ~8 w0 D: C2 [ }6 X+ ` "id" => $shortname."_timthumb_activate",
8 B/ e& _( }. w( \' X "type" => "select",$ ]- u3 ]8 P/ A$ f
"std" => "No",
6 [) Y7 g3 j i& o+ V "options" => array("No", "Yes")),) V: e; S5 ~* z) R
0 B& Q# T9 e' u+ |2 J5 ?& k% X
array( "name" => "If Timthumb is enabled, Please choose its cropping method",8 I2 W3 `1 A4 ~9 U
"id" => $shortname."_timthumb_cropping",
, K5 h- A7 e w# |; ~6 k "type" => "select",
% }( b: x, J8 P [ "std" => "",8 Z6 f, U" O; w9 G# w
"options" => $crop_position),4 Z0 s2 _' x' [# e
7 Q9 m8 N( o% X* }; o array( "name" => "Insert Width Of Thumbnail Image<br />
, K4 f! p b8 {$ ?0 `% w3 |+ U <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
, }( \# ~5 ~" P5 m& ^ <em>*Leave Blank To Use Default: 250</em><br />",4 h' C8 `$ f! k, ?
"id" => $shortname."_thumb_width",
* j u- ?0 Y& e! r0 c "type" => "text",
4 h5 v! H2 A3 U3 D" x7 n5 g "std" => "",; S/ g4 m( e5 B0 }; J
),7 P. B. p% A# W1 T; y$ r$ X
; R1 |& e! H2 \ array( "name" => "Insert Height Of Thumbnail Image<br />" j$ t( b. n! L! ]7 A+ x
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />. x, H$ ?/ X: Y0 k
<em>*Leave Blank To Use Default: 200</em><br />",: g; p: I6 H) Z
"id" => $shortname."_thumb_height",
R8 r+ [. T! \5 N% o "type" => "text",- J c& ^/ E) \4 ~2 v7 G
"std" => "",
( E, @8 R( a9 N& x ),, U3 E' l. q4 C8 E
# V: f: Z F) g6 P6 H2 o% F
array( "name" => "</div></div>",/ y& o1 b) v B5 h% |# }& q
"type" => "close",
: \; z2 I; v. z ),
9 ?2 s$ @3 b0 h5 P/ s1 s! N0 X8 ]- ?6 R: K. l5 V7 i V Y6 n
array( "name" => "Featured Content Slider Settings",
g, Z6 |! P5 ? "type" => "heading",
. N- C. I, q8 E/ ?/ t ),7 y" l: h0 B0 ^1 ^: l
7 N" l- }8 c1 a# t5 K' u+ F5 b
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
' l$ k7 D6 c3 z "id" => $shortname."_featured_activate",
" A4 l# A/ R( m/ i' K5 s" J "type" => "select",
6 q$ ]+ T3 h+ _ "std" => "No",
7 s8 g8 k7 v3 n7 Z% ]5 K "options" => array("No", "Yes")),
: \' b9 m* A2 S1 d* U/ D4 Q% N x4 `( c1 N1 c
5 A& h! L) O6 ?: @
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
8 |4 U K( I4 n- f# @ "id" => $shortname."_featured_category",
+ D% K( O# {+ c2 H- z "type" => "select",
- h. P) V1 ^( E: R2 h4 L, t- s0 [# c "std" => "Choose a category:",
& h5 N9 O9 e8 G7 Y/ K5 L/ \ "options" => $wp_getcat),
3 g; }0 [5 Z6 f c9 w' h" N; m1 l# W) H3 c
array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",$ a. b9 c5 ]4 w2 H
"id" => $shortname."_featured_number",( x7 q9 M1 K9 Y6 z
"type" => "select",, L# o. `. ^7 R
"std" => "Number of post:",+ o7 N: W8 s1 n2 x) Q4 K2 k% \
"options" => $number_entries),
/ M# s2 t( j6 x* |( A
, q$ f& s4 V2 v# W array( "name" => "</div></div>",
/ I. ]6 x( J$ U( b0 C$ E "type" => "close",3 L* d. Z* R4 d% S9 y- A. x8 O
),
3 b, M! b8 G. o$ z
3 u+ L' d8 F/ a% F+ m& v array( "name" => "Featured Category Settings",
& ] O* d! c1 G "type" => "heading",! ^ u o X* `4 M6 W
),7 u$ n3 o9 _( @ [0 u# X6 P7 j
" b) r* W2 c) N* V array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 d( W2 A+ p) n2 W
"id" => $shortname."_featured_category_activate",% s5 A {1 F8 A, q4 V5 S/ ~
"type" => "select",
( f! L: B" |, ~. W* P* p4 N8 `' \9 n "std" => "No",
" x% c6 _; Y _" p; i* [- P "options" => array("No", "Yes")),6 s; |% S! `1 j
( q/ K6 C" a/ b. ]/ a$ [ array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
& b+ _3 |1 Z) U/ b "id" => $shortname."_featured_category_id1",: M3 V( j% X/ t5 c
"type" => "select",
6 E8 c0 n& V3 {9 I5 }# n8 K "std" => "Choose a category:",
2 a6 H3 e& t7 a5 C6 F "options" => $wp_getcat),
( m9 K4 ?1 y+ f) I4 B) a
5 C& y, N& Q. R array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 i" t& A! l# @+ m0 v/ F9 Q: }2 a "id" => $shortname."_featured_number1",; w7 J6 Q e' I7 h9 b: T' y$ c$ o
"type" => "select",
; o& p1 G- B9 e: x. _9 v "std" => "Number of post:",
p Z5 g$ X/ Y( g8 @! r "options" => $number_entries),
$ {6 [- y9 b( C- r3 j' w
$ A1 r5 f/ Z! b2 x array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",0 |* E# i/ v, i8 n
"id" => $shortname."_featured_category_id2",
" E9 K. @% m2 S! j* ` "type" => "select",# l' I. ?# A% o4 ~) F
"std" => "Choose a category:",
$ C; S5 i+ }* r7 s "options" => $wp_getcat),
" Q% U7 o @& ~' u 0 l. n( M; J# n7 O
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
5 y( x ?% a* @ "id" => $shortname."_featured_number2",, }# V2 x! _8 s) o4 j
"type" => "select",
3 V" X. E- ]0 _% J "std" => "Number of post:",
' [2 T9 V5 |1 V( G( h- [3 V( n0 u "options" => $number_entries),0 ?8 G7 s e7 b! p
6 O. I* |' P5 A! Q6 D: Y; @% w9 X
3 ?, d4 I6 y8 j8 ?: B
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",0 C/ ~) S9 m9 G4 n' j, {) d3 o
"id" => $shortname."_featured_category_id3",2 \# \" `4 t5 F% S- N. V6 M! D
"type" => "select",4 g3 k. G" ]5 R- B# Q% \) ]
"std" => "Choose a category:",
7 Z3 V0 R! V' m; \8 e* S" \ "options" => $wp_getcat),
% ^7 }4 ?) g1 p3 x- K$ y - y$ A, o3 Z+ \8 @8 A2 W+ e
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
. Y9 B' o, e/ v# i9 r "id" => $shortname."_featured_number3",
3 J r; b( V, f! H9 W "type" => "select",5 E/ R' t6 {0 `$ y
"std" => "Number of post:",
: I# \2 W5 E+ B( T, J# {! U# N9 H "options" => $number_entries),
5 z8 X% u! ~7 \& u2 s) E
+ l0 u, O; I- y5 M8 x, }
7 U1 u0 S$ G. ]4 y$ _ array( "name" => "</div></div>",4 N+ N: Z8 s% Z! t: k
"type" => "close",
& H$ S9 k. _+ ~7 D4 }3 j! D; ~) i ),
7 o! p% w1 X) |- _# O) N$ @; I) D6 O" d" z3 R" W7 Z: \/ b
, {* g( N; F5 h
array( "name" => "Google Adsense & Analytics Settings",
/ b# N4 ~: ?$ a' e1 ]% p "type" => "heading",
. G0 W! p }9 d3 p1 [ ),
7 r: k8 @9 A5 n7 J$ M8 ^& i7 U& S: N
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
' k/ U$ v. H- i "id" => $shortname."_adsense_loop_activate",$ {& f) u1 ~9 E7 \
"type" => "select",1 K. h: i5 j# D1 q7 K4 v9 O; O! K
"std" => "Disable",
; z; L* c( m& [2 k; R3 Z8 i1 f8 M "options" => array("Disable", "Enable")),
+ X# c" |- n& w- [% s6 G" j& f( b; }) N4 \" d( k& p
array( "name" => "Insert Google Adsense Code For Loops Here<br />
: f! i( K- j. O <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",: g# l& L0 @& k$ o! `8 T ^
"id" => $shortname."_adsense_loop",
/ H7 D4 {4 {4 T! F- Y "type" => "textarea",. y1 H, `0 j: J$ ~( [- v2 p
"std" => "",
8 `& T5 G/ @6 n9 K& q: h. @4 c, g+ x ),! z$ v+ @- l$ K8 V% U
' m; S; q- ]* k; `0 P, _ array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>", C# W) u7 _" U# Z; t7 v( |$ K
"id" => $shortname."_adsense_single_activate",
- k$ @7 X# s% S1 L% Z+ ^6 X1 Z) y2 @ "type" => "select",
; [* H) c* X M3 C$ Y) k# ]( } "std" => "Disable",1 r" J7 U8 i9 O" }3 d4 B& n
"options" => array("Disable", "Enable")),; E% a: m4 i: K5 O' p: u7 e
+ r: i2 R! ?( Q; Q \ array( "name" => "Insert Google Adsense Code For Single Page Here<br />: I2 {/ K t% l* R$ y, x( A
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
5 @( i" _) J$ E: U% i "id" => $shortname."_adsense_single",
) ]) k3 n- p' e5 c: t/ Y* c "type" => "textarea",
5 L( m7 {* D& `2 f6 q "std" => "",2 F9 }0 q7 t; r8 F' r) L
),; A( f Z, j( E9 `' S/ g
$ ~; f: \) }6 v
* X# A( o& `# y1 o
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",8 q; Z( L; C) Q$ D, a i, P j
"id" => $shortname."_google_analytics",
3 m! A5 \% g: |) X8 W2 V+ o "type" => "textarea",4 M9 }" w1 L1 L, x3 i6 a/ R
"std" => "",$ T) w6 Q2 Q3 e9 {0 b
),( _& S) o* S* y: x h0 i. B. w
/ U$ u- u3 V3 W/ a8 l& r/ q array( "name" => "</div></div>",. z% h2 d* M" ~ {3 W" b# U
"type" => "close",8 F8 }0 s+ J* y
),0 ?) r4 P; I& Y8 y+ ?* F
q* M; c8 s/ O# g! r+ ?, l6 p ; W b$ h3 E+ @$ X- W5 ]0 M5 G
array( "name" => "AddThis Social Bookmarking Settings",
0 D( ]# A [* k' ]1 C "type" => "heading",
+ Z+ |3 I9 O/ `; {6 s* @; }) X ),5 t7 `% s; R) l( G$ a. ] ]% r: r
8 x, c3 F8 ^7 x8 G+ K" O array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
# n3 R( e/ G3 |5 \ <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",/ r) B" P' m5 y5 V$ ^
"id" => $shortname."_addthis",
( i, R) ^; F. H ^8 S: y "type" => "text",
: V ^* Y% [+ J1 C# r1 b "box" => "social",* E h; [7 y+ @, w
"std" => "",
& C- E; L. F7 q$ S+ F5 s9 R ),
7 {: T5 t8 Q- X$ h" c* ]
: L2 t+ p: f* j array( "name" => "</div></div>",6 }, Y7 ^' S! h! N
"type" => "close",
% T5 y/ q# l8 F/ i6 k ),/ m4 t1 a; I( K. t
5 t9 z0 }& Y/ @+ V9 |
+ p, V' u9 _' W
; ]0 T/ f. }8 x array( "name" => "YouTube Video Settings",' b3 e0 E0 O- A+ N X9 ?3 l0 {
"type" => "heading",0 f7 A7 t" N4 @3 g# O5 D" Y
),
7 U) ^% [- l; e- G
. i5 v; o/ i5 C: N8 s' Y array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
o$ d/ S5 o# q4 F "id" => $shortname."_emvideo_activate",
) |3 [' V+ Y1 ] "type" => "select",
' K( x) |9 l, j$ m, Y "std" => "No",/ w! }9 Y. X; {; f$ s& w
"options" => array("No", "Yes")),% Z4 B& ` } k4 ^* {
3 P: ]: Z* \; ~) m" ~6 X array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",* A x& f- k. k+ \ U# O9 U
"id" => $shortname."_emvideo",; P6 t+ n$ m5 s# Y5 U' i% H: d
"std" => "",
7 X/ d9 |/ r& m7 s: n5 @& Q' z. h "type" => "text"),5 M( R! K) r" r. `5 B% p
. m$ U5 n4 P+ J: m2 N+ g: A& Q array( "name" => "</div></div>",+ h1 k; p N8 o# l W: R
"type" => "close",
, X2 h" G$ g& q* t' M+ J+ I ),
* e* e/ t: q7 b5 [8 w e# F* Z. U. l3 C5 y6 s/ ?
array( "name" => "Twitter Settings",
5 `7 j/ R F% ~ `( [ "type" => "heading",
) V$ S( Q1 k7 W, e6 x% r' O ),, {/ X7 b% D$ H2 {5 R! l6 V
" ~' q+ u. {$ A, W9 J: W! `* R1 O' j
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
, R+ _2 P: }2 L& j. k W "id" => $shortname."_twitter_activate",
$ O+ w& e) t0 J5 ?) M$ h3 c; Z "type" => "select",
% D: D0 ^$ \8 ^+ M "std" => "No",0 o. R" W+ H4 s$ P( m z
"options" => array("No", "Yes")),
m s5 W) q4 M' Q2 ]6 r$ D& l3 U
5 f' M$ n' N- o, |& B array( "name" => "Insert Your Twitter ID here
2 Q. A' _% D% c% y) Y <br /><em>*leave blank if not necessary</em>
* f( h* [0 D3 v3 h6 D. j7 P <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",) b/ z( c3 Z, h% M& o* P5 W/ ~
"id" => $shortname."_twitter",& ]8 y, i: K% Z6 J3 P5 a
"type" => "text",) q% r2 L- A1 v' N
"box" => "social"," P! |0 y* m5 a& ~
"std" => "",8 s3 J/ S. T4 n
)," N- G/ C- j* E8 f' ^: U
" g0 [& I. }0 Q. I' h) b8 w array( "name" => "Enter Twitter Feed Count here" z0 K6 Z/ C3 | f
<br /><em>*leave blank if not necessary</em>
0 p4 A1 d. g ^2 t0 { <br /><em>*Enter How Many Twitter Feed To Display</em>",
2 k0 {/ Q n, F) B" j "id" => $shortname."_twitter_count",8 t1 `5 Q0 X5 J5 w2 }# D
"type" => "text",# J: A- O3 Z- ?: `1 e0 @
"box" => "social",, z: u. l& S, B/ o( R4 g) L+ D. ?6 W
"std" => "",3 Z! C- _- i! A: j% V
),7 n; w( G5 ^/ O# i4 S
6 }3 u v0 h# [! w: `
array( "name" => "</div></div>",2 x* l E9 m) ?+ V0 g& `5 G
"type" => "close",
% Z5 [& s; H0 X2 b/ m; A' X ),
' m) n! h2 R2 N5 i3 ?2 [ & r8 Z4 A, n, ?8 R5 w. O0 N
2 }) g# k! q, D9 X+ ~ array( "name" => "125 x 125 Banners Advertisement Settings",
: _1 s5 y1 u; \3 ?/ g9 A "type" => "heading", Y/ |4 p4 n! t5 _) B- ~4 x" G
),7 G3 [6 q \$ U4 @* l' |
8 o1 ]8 Y" V" {! l array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" Y F/ d6 X$ `. n$ z/ r6 N3 B "id" => $shortname."_sponsor_activate",+ D$ _! e' H) C# b" O4 e" k
"type" => "select",) s$ [2 Y' z4 y( k% z/ i
"std" => "No",9 r3 W$ l4 R: T/ H! l1 U7 A9 X- [0 @
"options" => array("No", "Yes")),! K* z4 O1 C( F! e0 b8 S$ I
6 q6 p* K/ B1 v% a
* L. ?( ~; U4 u$ L- [ array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",7 b. g0 t! i$ f) M9 T
"id" => $shortname."_sponsor_banner_one",- x4 l& o5 j8 D' H L; Z/ Z8 O
"type" => "textarea",
2 e' P2 Q1 k5 ~3 V' m "std" => "",
' e; a7 U( @6 m8 C ), & @0 ? b) e) h! Q+ O( ~* U5 l1 D
: _( [, B5 @) [3 T& F; S1 y8 H/ ?) n array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
! C; T: M0 |5 A: o6 ^ "id" => $shortname."_sponsor_banner_two",
. e6 |$ N3 K p- u "type" => "textarea",
! a* r3 Z( g3 O/ Q- z2 O "std" => "",* A* I3 ^! s. m8 x( v+ e
),2 ~* @# p8 j3 z; l
! o5 k- A! N; E! l3 v/ M array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",& s8 v! d' {# z5 u6 ^
"id" => $shortname."_sponsor_banner_three",! o& W4 G( D: \( A+ q% \/ S% ~
"type" => "textarea",7 A. I9 X) ?3 ?# j. M: @
"std" => "",1 P% b; d- w( B7 _
),
2 e7 f% b5 r5 c& x f, x* o) U& ]
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
3 C+ u! S$ l2 D N, V9 |9 _ "id" => $shortname."_sponsor_banner_four",
]( p) J1 A2 I O: c" m: d "type" => "textarea",; ~6 M" j, d9 Z
"std" => "",/ u; M; D+ j+ B$ K9 J& h
),* V8 y! @3 L8 |) b d
) X9 T+ ?% _. S0 q array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",' Y! y4 Y* F4 J, }
"id" => $shortname."_sponsor_banner_five",2 V" F; H4 B$ V: }
"type" => "textarea",: |( P* F4 k3 ]$ \$ K
"std" => "",
& D! I: z- v! N0 @$ j$ S1 C$ u2 r1 { ),
! s" w; h/ F! N+ a! p* T T) r' m# }1 Z' z6 M
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",0 }/ s+ h/ C6 b. U) Z3 C
"id" => $shortname."_sponsor_banner_six",! d5 C8 D, q6 ^. a9 y
"type" => "textarea",
r8 T# u% P% f7 n4 w [# M/ ?8 x. g "std" => "",- U5 o( H O) r* G
)," @% g& a+ ?2 i, K; q
0 F2 O3 N4 ]& i" i( ?3 i/ ~& k5 Q0 J array( "name" => "</div></div>",
/ q9 X$ x( Z0 G1 k5 } "type" => "close",
- Z2 u0 e ~' {7 P" S m: F ),
5 F+ \4 J& J1 r& F( y. B% C( m# ]( q4 e x, ]5 L2 [+ o* T
@* `" k2 U9 ~! R) n+ ]4 P
1 P9 ^4 M$ s/ v4 N4 V! F);
$ z2 K' v! B; N0 j; p: C
. }; e" j$ l* W/ ]+ tfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
5 [" B3 V; Q. F: w
+ [' a5 {! |8 q; r6 Fecho "<div id=\"admin-options\"> ";; ~0 e$ n s* }/ d. s
8 W! P6 S8 `" x3 y: I2 wglobal $themename, $shortname, $options;
- _3 ]: C, I9 B Bif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';
; n- p1 a) [+ S* D# }7 B3 g. _if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';* r# z) j' X9 u/ R: I8 n/ c
?>+ o" p- S+ I. s
7 T/ L6 E# x: z$ u* m<h4><?php echo "$themename"; ?> Theme Options</h4>
1 |7 g. D/ K& N" h
0 T" u6 k8 |( v% f) I<div class="annouce">
0 I z& Q4 `* s, W2 C7 w<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
' |' O) W8 i6 [; ?<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>4 E, t7 {( y, p# x( j7 A
</div>
- g3 ~) C) O8 ~" @4 A! a- K8 r" l4 X7 q0 V ~9 ^8 O
<form action="" method="post">
7 X' i2 o3 N2 A2 w! y
% n0 X" }. w6 `. z8 g5 B! f* h/ ]<?php foreach ($options as $value) { ?>; j4 z) {5 ?6 V9 u) M
) u9 J. F5 A+ a5 B6 J<?php switch ( $value['type'] ) { case 'heading': ?>
/ c4 u" ]9 b1 ]: |1 ]* X+ B' ]
6 T5 c- A) w9 E; j<div class="get-option">
M4 Y" L* L4 w, [: q, Q
9 r# E/ d! {; b# P7 _& E<h2><?php echo $value['name']; ?></h2>" i8 Y! W% Q! j& B* N* u
! K4 p- Z; K3 V% r) ]1 Y<div class="option-save">
8 a- o5 e: i- v0 }! o, @& \: V5 p: e
<?php9 x1 w& B& k/ E5 F1 v
break;
0 p0 i& H6 |2 {" I* v- ucase 'text':
! Q* j# J2 P: r?> ]+ v8 k- o: `: W* C( [
2 V4 ^8 ? _ g m6 p
<div class="description"><?php echo $value['name']; ?></div>
8 n4 J: Q3 z/ _# N0 R, x<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
0 v, J4 b- e. V; C& m" w: J7 {( k5 P# B2 u" a) |
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
) _. `! j, d" \3 k, u9 z& o; q" L8 v1 e* A
<?php
9 M. j( y) I: w; ^7 O5 sbreak;
$ K) T6 K, @4 [8 ^4 ~case 'select':4 F+ u( E! H4 @1 f4 g
?>8 w) i5 ~& B! m" a
6 s* i8 H! `: j/ w6 R1 j- @9 Q
<div class="description"><?php echo $value['name']; ?></div># g1 @+ F/ T; {; G/ M
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">' G6 {! H; @4 P
<?php foreach ($value['options'] as $option) { ?>
- }" {# n- g$ k O# F<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
: }5 w8 v+ b" V* J, i4 G<?php } ?> U/ Y/ B0 X3 I8 S. G1 o B
</select>9 w1 E& O0 O$ k, D! a
</p>
3 P3 R1 D! P# p; Q/ v( d! p3 @) ~
<?php# I; C6 _& G0 |5 f) h b
break;1 o4 j7 p# G3 `3 p" w
case 'textarea':
. M' F y& r( R) q$valuex = $value['id'];7 Z0 v4 _! X) W1 f9 N1 k; t2 k* E# E
$valuey = stripslashes($valuex);. J" {& O2 |- c: B1 z
$video_code = get_settings($valuey);
- F/ m; h7 S+ S8 s* N?>
5 b1 `0 @1 V( e* S) Q, [
4 M/ G9 F. s8 s; U9 ^: l<div class="description"><?php echo $value['name']; ?></div>
0 L# b. i/ }, x4 T+ L* |<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
& v# U4 N$ e5 d |( s1 s" C& l, b, {1 `
else { echo $value['std']; } ?></textarea></p>4 w% J' p% j6 k( _
" e7 w1 e. Y2 y% g- Y
<?php
. @$ e* u- ?; l% j. X4 q ~break;3 _5 U4 D5 u+ M9 `+ y. M7 j' M
case 'close':
4 b" p2 R- g! h5 o?>
* @ o7 R$ f9 @ B0 g$ r T1 w2 ~) Q* m2 d6 Z, K+ B" H) @9 N, N) y
<div class="clearfix"></div>* V% _; k7 N% C' S& T
</div><!-- OPTION SAVE END -->
3 F' p O( V# x i2 Q$ E
. Z0 G: P4 a. j, R<div class="clearfix"></div>0 Z8 ^* V6 O1 T8 \; _9 [
</div><!-- GET OPTION END -->2 s/ {* o7 L" ]+ @3 Z3 A
- T' j2 T$ C; n( |<?php4 G& S2 {: n9 [4 h, z
break;# N& [2 F" }9 V
default;
8 Q# q" C, b6 B4 k9 c6 I9 e+ d?># {) B1 s. _& x$ G' A' P0 x& F
6 R7 _* {3 s" S- M3 V8 ^5 R+ ^ n0 e' S B/ i" w2 |$ `
<?php
3 C- \3 i" R1 ]9 Kbreak; } ?>0 Z" K% V& F$ g
& [- m/ Y# P( u2 D
<?php } ?>3 A' S2 Y |1 t8 |
3 L: T8 m: S7 Q4 x q" W) }
<p class="save-p">. J; ~, X& x5 Z' F/ t: _- x/ X
<input name="save" type="submit" class="sbutton" value="Save Options" />
5 }1 C! n- t, T0 m n- i. x( M2 |<input type="hidden" name="action" value="save" />% v d' D; q ]8 X; u
</p>
$ t. \4 o: r1 o3 k( \</form>3 R6 h4 _# T2 E# V/ R
- N7 U0 r ?1 [<form method="post">" N h- k: h. N* Z* W( V$ q% X
<p class="save-p">
# M4 Z4 \4 t7 J% [<input name="reset" type="submit" class="sbutton" value="Reset Options" />0 c Q/ |* B) B
<input type="hidden" name="action" value="reset" />. o7 h- F7 J, e4 O
</p>1 U: M0 H: ]- z
</form>
* U5 ^% j7 s+ x5 T: d
$ `9 @9 _ ^, Q3 e) {, d</div><!-- ADMIN OPTIONS END -->% p# H* Q2 l" F+ ^
$ a; M9 b6 p& [4 M<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
' K( w" d/ S0 q( o j$ B) O9 }! r+ ^: b5 G
function mytheme_admin_register() {
$ T" `7 J8 d/ I4 Bglobal $themename, $shortname, $options;
- i4 t7 `( I* s7 s( P' Rif ( $_GET['page'] == basename(__FILE__) ) {- p& X+ N n% L7 B0 Z7 ^1 b. p' }
if ( 'save' == $_REQUEST['action'] ) {( t+ B2 N2 |& c* Q4 d- \
foreach ($options as $value) {$ s% {: ? L" a% @7 m
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
! x7 `8 }' `2 H! ^foreach ($options as $value) {, f ~3 [$ M% k& ]" _; i
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
+ ]: X( ~7 S! K' J5 _header("Location: themes.php?page=functions.php&saved=true");
1 J$ g6 J; z0 p8 ddie;3 j% c9 V4 R( _6 I
} else if( 'reset' == $_REQUEST['action'] ) {) D- L8 a- @+ L4 ^
foreach ($options as $value) {7 p$ X7 ~" Q. s
delete_option( $value['id'] ); }4 `' `9 Y+ }# b, g
header("Location: themes.php?page=functions.php&reset=true");5 j6 X, I* S% I% g" j
die;
8 K0 T: F/ A7 i( H}
' R2 b: q% Z. y}
9 p' \$ s. u% k+ D3 V7 Kadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
- ^4 ]9 V) J, ]- e) g# k+ ^}
( \* X( i$ q& o3 F, u+ y- X- O3 E
function mytheme_admin_head() { ?>( D, ?) }; q( r+ X* ] D! A( M8 ^
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />" F9 W! r3 |: B: d$ Y
<?php }
. @" C' H' p: Q0 q0 N9 ~% S |
|