|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
* @9 Q! ^$ N4 L! }) X" }// Theme Option
( x: T0 k# B' V( F, a////////////////////////////////////////////////////////////////////////////////
) @8 q+ M6 B' f4 o
3 {) t" Q2 |0 Z$themename = "Zenx";
, I2 U3 ^) C- p& e$shortname = str_replace(' ', '_', strtolower($themename));
+ e1 _3 A0 Q+ J. O* O7 B% t: c
p/ d1 G7 N% C ]function get_theme_option($option)
8 ^) Z7 k% e$ s/ f& ]2 i{
0 x# W/ f8 B( V1 r: e6 z( z' \ global $shortname;
9 b3 L2 r6 |9 N8 q! F return stripslashes(get_option($shortname . '_' . $option));
9 U6 n/ m3 [+ w& }}
4 O6 c; C% }$ z @- m. C! t/ P5 f' i* v) t7 k
function get_theme_settings($option). b" B( F3 e' r- y4 G# _
{9 K& c- F6 T% k! H" i. x! p
return stripslashes(get_option($option));. Q5 P, R8 H7 t: {
}
* |2 A/ w9 s2 [! J+ a+ G$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");0 L- W7 o5 h7 V/ |- B
$wp_getcat = array();
. p- D2 c+ h& S6 y, ]foreach ($wp_dropdown_rd_admin as $category_list) {
3 @8 P) h- h, l( ]+ i' f: ]$wp_getcat[$category_list->term_id] = $category_list->name;) n$ e2 G/ w& R0 C( B' f P" P, |
}
0 f% m" O8 z6 [+ B$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");) t! m1 ?) B9 P" r. q) S A- ~/ ^
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");4 g0 w4 U1 D4 a! v
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
# _; t- X% k% A- T$ `$ f n! W; Y" k8 E3 G. F6 E8 B# ~) x
$options = array (: |8 Z) k% d: @1 N
u, }+ r+ B5 K5 [1 ?+ m1 s ~' u0 Y" }% T# D
array( "name" => "Blog Header Settings",' T# O: G0 O. d6 z9 v! [0 H4 E
"type" => "heading",; |* y7 v( M4 ], |2 |
),
8 g5 D5 g% [, Q% T1 m! r" ? N0 K' H5 C* |# R
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
$ V! n4 t/ a9 ~ "id" => $shortname."_header_logo_activate",1 j3 `6 P; A" ]5 r# Y0 ?
"type" => "select",
5 X ? A- s( l6 a/ c "std" => "No",% K8 ]7 X% L1 B/ p& q4 x/ \* A
"options" => array("No", "Yes")),
; @0 j! D3 ?# |/ ?' H/ U1 n X/ p" w" @$ X2 y
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",
3 _: P! ?% E) t y7 j# s1 B; `3 g2 b "id" => $shortname."_logo_url",6 {- ~ b& G6 a
"type" => "text",+ Q! h3 C# r% q# v
"box" => "social",( W. H4 `3 `$ S
"std" => "",
2 g& S3 \- B$ L ),
# r1 m1 p) {2 X1 d) X. p: @9 s0 u
% I5 J) \: w( I* ^ array( "name" => "Insert Header Banner HTML Code (Header)5 a2 _ E$ I9 Z$ ^2 F6 |
<br /><em>*Recommended Size 468 x 60</em>
. `) B: C8 |4 o6 z <br /><em>*leave blank if not use</em>",* D ^8 u2 P, z; J, W4 `+ b' Y7 m2 }
"id" => $shortname."_header_banner",
2 |- @# V3 x- n1 {% v "type" => "textarea",+ g: I+ g9 s; U7 P' e0 y
"std" => "",+ F$ X* ?5 s4 @' T0 W9 q5 {
),
1 _2 z0 x) k5 ~8 o4 F; W- \; I/ e3 [
8 r; j8 r) n- A& W array( "name" => "</div></div>",5 Y% x V( j) r6 r$ D6 |3 s9 n8 `
"type" => "close",
2 ?5 v' q" l% c8 D9 | ),
5 N8 b) n m; K; |3 h
$ A- i B5 z5 O) q2 q/ l8 H- ?" u' C" ^
array( "name" => "Header Navigation Settings",6 ]3 x6 w! u- l3 r) C2 C6 h
"type" => "heading",- s# l3 _0 t w7 `2 \% w( x8 m6 ~
),
$ B: m( ], w6 i, C m |
0 F# k# E# U. \ array( "name" => "Insert Page ID To Exclude On Header Navigation<br /> d& R: K# d( C- l
<em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
: |' L& u$ }4 r, R0 K- ` <em>*Enter the page post ID number only</em><br />
" M9 m6 g: W D' b1 ` <em>*separate by comma</em><br />
8 D* z: p f* m5 Y/ w8 m+ F <em>*Exclude pages which you don't want to show on the header navigation</em>",
; w3 Q1 [3 v; p "id" => $shortname."_header_page_navigation",+ F! s6 o7 Q$ G% q
"type" => "text", }8 {7 Q2 J) e+ q$ F% A
"std" => "",
& L P6 G6 X! ?0 b# O5 x ),
! ^9 u2 y7 f2 ~3 c$ v# a4 Y( j/ A0 |6 s" i7 [) ]% P* |/ {0 ?9 S
array( "name" => "</div></div>",$ r! F: a! r0 N t
"type" => "close",
( N1 F" H7 F$ W1 k9 U; V# K/ Z/ m ),( n) R$ h1 t: T4 P' Y9 a5 b9 `4 j
# C+ q/ @9 q+ r5 E* N( h1 H- l; b/ p* b9 o6 a* z
array( "name" => "Post Auto Thumbnails Settings",
* H( E. D: B. q s; m5 y "type" => "heading",
& @7 x+ f d9 b. Q ),
1 K! ]0 L a2 E( @# Z) q* a2 z
9 b- `: |' v/ Q4 V% q! S. C8 w array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>"," ~* u- W: Q; s3 }2 y1 ]
"id" => $shortname."_timthumb_activate",
: z6 U4 H( `# i8 c, h9 ~! [ "type" => "select",( _6 ~! ]; P6 P" B5 T$ f9 `
"std" => "No",
% N: i# Z- |& E* Y1 U& ] "options" => array("No", "Yes")),; z, W6 N. Y2 s, z" [9 {) b
7 a+ @7 |- ]/ G4 K' I6 W array( "name" => "If Timthumb is enabled, Please choose its cropping method",
* ]0 p& u1 h z* D* c6 a4 a8 h8 F "id" => $shortname."_timthumb_cropping",7 x2 O* s& u6 F3 e
"type" => "select",! v" O2 d' M" G" f" h! r
"std" => "",
; B8 Z! e; r" g7 C @8 Q1 i( Y "options" => $crop_position),
: m; }" L0 p/ f2 |1 n2 b+ ^
+ U) @! d8 ?) }: J1 G( n2 ~ array( "name" => "Insert Width Of Thumbnail Image<br />
' W2 Q' @, {; T; A <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
; ]/ S! P( S/ x <em>*Leave Blank To Use Default: 250</em><br />",. O4 z3 Y+ j! o' a/ d& Y3 [/ {
"id" => $shortname."_thumb_width",
: a; K& k9 ]! R F "type" => "text",
( F* d3 m' W$ l* P; X "std" => "",9 j1 j# V/ K Z7 i6 \0 _
),
/ q. H. A. m$ F& c8 o$ P- J0 c
5 _% {& O/ T; S5 ]+ R array( "name" => "Insert Height Of Thumbnail Image<br />% Q; Y5 n3 d' y3 L3 V9 j' D
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />( U5 [" Z. x7 l( L4 W
<em>*Leave Blank To Use Default: 200</em><br />"," i, @" C, h9 r2 u& K+ X0 B) _) j
"id" => $shortname."_thumb_height",
# g4 l# o6 `7 K$ F# Z "type" => "text",
/ n- q7 X6 t' d "std" => "",: G+ v4 ^1 u; x
),4 G: T1 U. l& F" e' k! }; @5 w3 ~
7 z- y' f' Z- K0 g; J3 t
array( "name" => "</div></div>",- B# Z7 i" Z1 H6 L, M
"type" => "close",
8 Q N( r1 y) q# Z# v9 q- X) m1 } ),& c' M8 Y& ?9 C S4 I s
0 Q$ [9 }( _: P/ a
array( "name" => "Featured Content Slider Settings",
; v, [5 p% C4 _! w7 W "type" => "heading",
7 s' X; b% G4 H9 z ),
3 B7 `4 m; e( }. m
8 E! u s1 u0 k$ \ T array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! ?1 `- l* s2 @( K8 [ W) u "id" => $shortname."_featured_activate",& d# V# J! u8 v9 t
"type" => "select",& v' [0 Q0 o+ d) W# g
"std" => "No",& n7 ~4 b0 H5 z% i5 g/ M" K* L; @5 y# k
"options" => array("No", "Yes")),
8 }4 ?" {1 i B/ z5 q
( H3 a& M) M2 c* J. Q, [0 y( p' C# ^
& F6 B+ Q4 A: z' q array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
q% m. d' s. O$ m0 S "id" => $shortname."_featured_category",6 i0 I8 b8 |8 |4 D/ H
"type" => "select",, g) b1 V' @8 {4 P$ k) e
"std" => "Choose a category:",- {; I# j& g' d9 }' H
"options" => $wp_getcat),4 D( k0 L( U# S: o& |$ l
& W3 e. R. {6 z/ E array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",. q' v1 X# F1 J; D
"id" => $shortname."_featured_number",
% q$ T) y' {' ~# v/ u8 i "type" => "select",
; M0 C! F7 L" R5 d "std" => "Number of post:",
0 `# e( T! ?: L+ c$ ~ "options" => $number_entries),
/ e) F1 D7 K6 M
- @! \! w. ?4 |8 t: |( i2 i array( "name" => "</div></div>",
* |1 ~; D+ p' z4 a "type" => "close",
2 L {. a2 n" u3 c5 L2 I, ] ),
$ y, d& E7 F6 ^2 o0 C6 S% C) g4 ?
% D7 X) e: f5 f4 g array( "name" => "Featured Category Settings",$ p2 a! @% h) s0 ?
"type" => "heading",) N( O" w) P) b; W* Q2 k2 X! ?0 G
),
9 w# z O3 W' o& }. Q/ f
( j2 Q1 R- g0 {- u, P- j" o" a. t; _ array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" ^- }4 S& n9 I5 a, ^* f "id" => $shortname."_featured_category_activate",
1 t- |8 u% Y. [2 M! \( m% @ "type" => "select",8 l) t6 t( F3 F% ~1 O
"std" => "No",
0 H0 ~6 m% \4 ?5 V$ j6 D "options" => array("No", "Yes"))," w0 X# [7 j0 @, O+ }7 d% o' G
* Q3 J( S4 g+ c6 C3 H* a2 V% c
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 n1 G! `8 H i6 e& { "id" => $shortname."_featured_category_id1",
( f$ A6 ^ u R. T7 X "type" => "select",
5 L6 f1 T. }" a* G. K" S* l; F9 K "std" => "Choose a category:",
3 F8 I; b5 {" \# ?% u "options" => $wp_getcat),
4 I8 H9 D [# }( n+ h5 G0 z 8 }- }. v1 E/ j$ _# T1 i2 G" v
array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
5 ]0 q- ~' P" ]* g% B [ "id" => $shortname."_featured_number1",5 _, q0 N" e4 E& {
"type" => "select",
1 s- h( `1 \5 v3 j( j "std" => "Number of post:",
5 E) H4 y+ R; G; F( u2 p s% p5 C "options" => $number_entries),* ]$ G! M/ W) T
' e1 z+ u* F; Q. i array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",' U$ z& n) N y0 o* [
"id" => $shortname."_featured_category_id2",
8 ?9 @/ k% V8 \6 N2 O7 |& W "type" => "select",
, a, g( m. o' F; ]/ H7 x "std" => "Choose a category:",* ^- P! Q, N" [6 b* F$ K" o
"options" => $wp_getcat),
# K+ m ~# k: w* v4 H # g1 t1 y/ ]( M
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",9 B& Z* @; ^7 T/ J! T$ ?
"id" => $shortname."_featured_number2",2 N' K8 C" t9 C6 J
"type" => "select",
" o- }% N, b3 @; }& Q; B "std" => "Number of post:",) w& Y) [- S# o1 ~5 [( r- O
"options" => $number_entries),
# g% T% i) c% A5 Z 8 s! d& T/ V; e) O( @; T# w9 R! b, D
6 ]- H5 j. }! ~/ l3 a9 q
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
7 H9 Y+ X9 Q6 c) q2 h g "id" => $shortname."_featured_category_id3",
' v; S' y7 C8 C7 L% Z "type" => "select",* M+ O) [! C9 q+ N1 Q3 D! ~
"std" => "Choose a category:",
7 z( w7 C% w) V* X: ^5 j9 e" H9 ~ "options" => $wp_getcat),/ h1 D/ k( m9 b
8 Y& B. r' ~# P+ C% j
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
0 ^7 k+ v% F* h* H6 _0 D( ^ "id" => $shortname."_featured_number3",
" E7 _# M7 p4 I8 C* i "type" => "select",, T" e$ F% q4 N
"std" => "Number of post:",
6 x" R& [% `6 p: I "options" => $number_entries),' l7 @" [ k) R1 ]7 F8 z
* G5 Z8 x. b$ X
3 m! q/ m: V F" Z0 @
array( "name" => "</div></div>",
3 ?. |9 P" A/ @! U% F; ~0 m "type" => "close",- Y9 b* S- q- m: ^- K% {7 T: V
),' |: u; D2 o1 d: O/ r4 L R& f
+ P6 D! L& ^8 F. H+ {. \" Q. x( _5 ^5 t) X9 m
array( "name" => "Google Adsense & Analytics Settings",, |5 i3 _0 f+ v
"type" => "heading",
9 b4 x( W+ v- v ),, \" ]! ]9 t) v
; H7 D; f, Q& z, z" s5 ^/ M9 {
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",6 _4 `' T& V% j' _+ C4 Q
"id" => $shortname."_adsense_loop_activate",8 n6 d: j" }1 ~' O$ n$ e% W, Y
"type" => "select",
& N4 @& ~. F B( x "std" => "Disable",
* `7 }, P$ P" N# s0 i "options" => array("Disable", "Enable")),/ k- R$ Y4 o, T) E
, R0 j4 ^" g& a" d0 J/ e0 p array( "name" => "Insert Google Adsense Code For Loops Here<br />* ]) ` A, b6 J& Y
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
' I5 V3 P: I! R5 x "id" => $shortname."_adsense_loop",# m) J) d, m2 |/ q
"type" => "textarea",
7 D1 m9 ]& i8 @" H/ k T$ ?9 m "std" => "",
; T3 I( s4 \: r0 T A% W# ^( ] ),! ^- S" ]. L' V3 t
+ y& z7 g' x' S5 ? y3 a" E1 q4 B' P array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",) t) H+ i2 c- ?$ f6 g5 g
"id" => $shortname."_adsense_single_activate",
" x- T5 ` F) Y! G& ~ "type" => "select",4 |. Z5 s5 g' e3 z5 j5 C
"std" => "Disable",
% Q' N. W, o3 A$ @) [ "options" => array("Disable", "Enable")),
# s) J4 B8 R3 g, D6 V5 ^4 `9 i L9 g3 j
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
5 M7 Q( k1 Z' o. G5 w/ [) P1 P <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
, q+ J+ }2 b0 L7 b# F8 @ "id" => $shortname."_adsense_single",
5 N3 e7 W! A: {* j3 j& a: N "type" => "textarea",3 G0 n: u; E# @8 r
"std" => "",
# G. K; s3 u) g( l" M- O ),# v8 N6 v( H6 a4 x
& j6 J8 f9 B5 |8 e4 c& l E4 Y1 j& |5 Y1 u0 G# M
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",; K) V, K' Z+ u4 z
"id" => $shortname."_google_analytics",- \$ Q o, `3 R. a9 |7 c# ?
"type" => "textarea",7 e- E! s: q% a+ S# p# s
"std" => "",1 p4 r: N7 X+ X+ _
),
5 c3 C0 x6 g1 H+ z* f' q4 S" G7 M- H4 j. E0 x
array( "name" => "</div></div>",
e- l, [* M' v "type" => "close",
6 s& K# y" M. x ),; @8 O; `( n! _( Z
9 T* m# z: Y# y {# B* b 8 t6 J' B& }( b
array( "name" => "AddThis Social Bookmarking Settings",) x6 q3 k4 N) N3 g2 y/ V
"type" => "heading",
! G( `3 W$ W, [* U6 ^* v, f4 H ),
5 L" r8 Z6 _ n' F, u& {( r* o c# q* m; z, Q( V$ f
array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>- {6 Z, l: o4 T0 v* r% Y- \" E" \
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
2 m. w* R8 M, f% g( _# q$ A' ? "id" => $shortname."_addthis",3 m$ `& a- R& f# R8 k
"type" => "text",
1 ]& ^0 y; \0 M4 y* _ "box" => "social",
. C* j: T7 q6 x# U, ~2 I# h "std" => "",. G5 |+ O$ m+ P6 Y; ]& D
),0 a% W P4 {1 Q6 y& A' V( t
! @7 u$ k$ G8 [1 r) S array( "name" => "</div></div>",
% g3 h. I1 x$ c "type" => "close"," t1 @" c# y/ m8 Y' z. r2 W9 n
),6 i, }9 Z9 @& l
9 ]7 j/ Y- C- V5 X$ O( A. p; J& W
9 P( S& p8 A+ k9 z" M" G: h& R
1 i/ N# y* g8 i! y$ d+ p7 h4 h array( "name" => "YouTube Video Settings",
+ g) f/ w5 ~, ]3 S "type" => "heading",
; E% P5 t: O% c ),
8 }; Z' c! ~+ z* P" t; H7 i6 M% H! I {* S
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
7 V) i2 w3 u6 Y [, W "id" => $shortname."_emvideo_activate",, ^4 J6 {: l' y: ]/ M4 f' E
"type" => "select"," [; }5 E, W8 |
"std" => "No",
7 h [( P" M* ^! h% ~ "options" => array("No", "Yes")),
- l8 p. {2 S. Z- [8 d$ z8 F: T& \% b
) C# Z/ ]/ s5 w5 [% o. u 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>",
0 h4 X$ ?$ R$ a! @& \ "id" => $shortname."_emvideo",6 O* C: ?; X* K, ]8 y- Q
"std" => ""," j0 K' F% C- f0 E
"type" => "text"),+ D/ y4 L/ v: e. a
( C5 @8 s E9 ?- S/ ^
array( "name" => "</div></div>",
' q7 Q% a" d" ?: Y$ e) L "type" => "close", h* }2 x: P) a' Y$ f3 x
),
0 y8 w3 V5 m- Q2 K+ K+ D
; B- h9 Q3 i# o% P, k* O array( "name" => "Twitter Settings",
2 [, x# t3 g0 }0 @- P" n "type" => "heading",
" F* ?9 X2 T6 L6 [: R ),( K8 Q2 V0 w7 D7 V3 R2 M m
! N7 D! K3 B, P) j% H# m array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
$ m$ j* c8 g$ b" |8 v9 q: ? "id" => $shortname."_twitter_activate",2 N+ w2 m, L/ t7 }) s/ A
"type" => "select"," ~% r1 F2 ] U% ~+ n/ v" v& T
"std" => "No",
$ V% Q$ Y' g, ]" n b "options" => array("No", "Yes")),+ Y, Q3 H: u2 d" l3 k
8 c t8 q9 C4 t; L
array( "name" => "Insert Your Twitter ID here: n! ?) b$ b5 p. E
<br /><em>*leave blank if not necessary</em>% H. j$ s# M1 H" h4 N! e) Z' e
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
# s, I8 P6 x: Z( f) i: {3 N$ V0 O "id" => $shortname."_twitter",
# l [2 D. k* }* Q "type" => "text",! v6 E0 R& a' K9 N: q9 _( n
"box" => "social",2 a8 X, Z: s. v7 K! l2 ?7 V. \9 `
"std" => "",/ Y& P7 \' ]* p9 O/ ]) O+ t
),* ~* {$ n+ t! l t) U
( F6 X) g# |' Z" B array( "name" => "Enter Twitter Feed Count here
8 C: }0 t0 |0 A# {, [ <br /><em>*leave blank if not necessary</em>
0 _* s6 Y3 d$ ~ <br /><em>*Enter How Many Twitter Feed To Display</em>", \( r' `, i; `+ Q Z! R4 I
"id" => $shortname."_twitter_count",6 F) ^! {* s& Y, T$ d+ p6 }
"type" => "text",
' Z! a0 Q* @! _0 c) A "box" => "social",7 D& A2 e E I6 e# a
"std" => "", E( @0 f( B% ^/ s& {
),
' \1 D. j2 m& X/ S! e1 s1 r
' a0 q" G8 z5 x4 ? array( "name" => "</div></div>",
' k+ Y/ L) x/ p9 `7 J8 f0 `% A "type" => "close",( C7 U- B4 P6 E* z P) Q# v: `1 o+ I: ~
),
$ ?& L1 D+ z7 g/ D9 B' {" l
% Y% \( R6 `( j& y/ z
' H$ X V7 ^6 T# B7 k; ]5 q array( "name" => "125 x 125 Banners Advertisement Settings",; I- H+ ^1 [8 I$ n6 t7 I
"type" => "heading",$ Q) t9 d, N: [+ ~2 f& L) M
),* H- D2 B* K# e( F. i
5 m4 V5 ` G/ u3 a, P0 C# J2 M
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
, k! }% W* x7 k" t" B7 Z8 y g/ k6 g "id" => $shortname."_sponsor_activate",
9 p! ^! A: n' X8 y' D) K4 }( s4 p "type" => "select",! ]" n9 a- b! V1 J: q- s
"std" => "No",. I% y: x4 y. u1 \" N2 W' |
"options" => array("No", "Yes")),. B* X) v+ u: D0 v! q6 i2 U
# S9 M d* l: g7 n
! |6 T2 \! N- a array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",% ^+ M s$ S& @# b) h
"id" => $shortname."_sponsor_banner_one",# S. E1 @: M# n$ U3 ^
"type" => "textarea",) [ [: C/ G* W
"std" => "",
, Y; n1 ?$ ^$ {: v. f ),
& \ X# F1 | e: t! u/ u& X |7 A: e# U- K0 i
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",' r9 P; w8 s" N5 { q( {6 S
"id" => $shortname."_sponsor_banner_two",
* ^, G/ e5 O- r9 ]; N "type" => "textarea",
$ _$ e. i/ E" C( o "std" => "",
j4 R7 z Z8 |9 v ),8 L. q& ~+ _1 `/ Y( \# K. ~
; o. A) A" e, [1 ` array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
4 P6 L: t! A( k# Y' l9 M "id" => $shortname."_sponsor_banner_three",
+ |* a" v, G! Z% s' S "type" => "textarea",; H* t1 ^! b/ f3 k# b
"std" => "",, ]+ j8 @. l1 k- i- Y
),( x( e& u' p! B, n$ k! U
+ A* U$ X' t& ?9 g: a
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
6 U1 o1 E z# J J& I: c( f "id" => $shortname."_sponsor_banner_four",1 C& y, g; _$ I4 Y' x
"type" => "textarea",
" P4 h M0 e# v$ i7 Q+ D8 l9 ]& z "std" => "",
8 T% A2 b: C" k% `, u ),
4 W( {/ Y! {* U0 r
/ u A8 j: W5 R3 C& u array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
9 x- B- M' B2 s5 ?1 H/ O. |1 c "id" => $shortname."_sponsor_banner_five",
. ?3 D3 l7 i& V "type" => "textarea",
4 i# }: X4 ^6 ]4 c! u7 m "std" => "",
5 ^8 `' N# P- N ),
0 n- x% j' J6 W I. e+ o: _
+ P! \" X- Z7 G9 [ array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
5 e+ R2 j$ X7 Z6 w( S5 j "id" => $shortname."_sponsor_banner_six",# B! R% T8 x6 H* ^ d) y
"type" => "textarea",
( E0 Q% J8 J- F: L7 ]6 V "std" => "",
- u; n7 }: j. V+ i$ F8 Y1 Y ),
6 L% @7 {' q8 Q' w1 X) T% r
: i: ]4 E8 E$ I array( "name" => "</div></div>",
y+ M, [$ t& [; I "type" => "close",
2 X6 e- Z' L, @ ),7 r9 |+ x0 s1 O- t
' [1 [" u9 b& P- H1 E+ X8 g
" d# G$ l6 Z$ \* X, o: V4 t# Z: e+ @ J# a, Q$ I3 |/ p
);+ u: H9 J+ D" F' U9 j8 i0 E" Z% M
d! N% s" X# A5 A' |$ Hfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {& F+ i8 Z% ~2 u
: H2 k/ e- ] N {+ \
echo "<div id=\"admin-options\"> ";3 O+ K# n: A/ q, h
$ G$ ^. y+ d, Y }2 p0 iglobal $themename, $shortname, $options;
1 `2 }$ _# s: c) P) U0 I* Eif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>'; I$ Q$ o% ?) K) b* B9 ]# X2 x6 Y
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';" m( M, B0 S$ {9 E
?>2 U3 k3 D0 ]; m
1 y Y/ T, U' U4 q) `2 c" A
<h4><?php echo "$themename"; ?> Theme Options</h4>* X; T" }5 O) [
8 B( x! t6 r' M" P6 d1 y<div class="annouce">
/ m& i) x u) Y3 n<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>" h% y5 ^4 V" u, N
<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>0 e5 \* J) n A+ B/ {
</div>* S0 A* R5 @2 |' G* Z
: ^' ]7 T n$ f6 k4 i<form action="" method="post">. ~8 Q3 ?+ e( O! `1 K
. _! E" _& x4 o% ~, Y
<?php foreach ($options as $value) { ?>4 f# [2 b: B! N* [
m: k, F3 g5 @& P D* y! ^: U
<?php switch ( $value['type'] ) { case 'heading': ?>
$ ~3 z* N! s8 N. m0 k9 \: \
! j) l4 F8 n& F& n<div class="get-option">( Q8 g# }( V- O$ l/ R. m
" _; K% f. g. H& b6 r h<h2><?php echo $value['name']; ?></h2>
) k. ~, C- L9 `$ c- m/ s
6 L" R7 Z3 x4 t( y, {<div class="option-save">
1 q: {5 v( v" ~% P& o
0 S |! p5 Z& d$ ^# m+ S<?php7 n3 U t. ~$ V+ _
break;
) e, k) A8 R) M# G9 T! Gcase 'text':
+ w8 V& X2 y5 r3 ^4 z2 ]! H" j?>
1 G4 {: Y& a9 H
8 Q# x* G" Z% `( q/ {! r<div class="description"><?php echo $value['name']; ?></div>
" j( E2 c% W* Q% O/ k. A<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (# x# g7 G7 ~' v8 j+ f- |- A
! |. I C# a% [5 f/ O# E
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>$ X6 M, U6 S; D. a0 n& }. p2 m
7 R: C" h( q. S) \
<?php
6 ?. j- }4 p$ R: H8 ^6 ubreak;
i' }. H' Y) \case 'select':* K5 H3 a! e G' U8 O+ X# v, A. d- W
?>) c$ M# v* u7 x9 B
: r5 G8 { C1 ?; ]* J4 L<div class="description"><?php echo $value['name']; ?></div>
/ j( X0 C# {$ R, \<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>"># v0 A: ~. I" o# o) O
<?php foreach ($value['options'] as $option) { ?>0 a' s7 _# }2 Y ^2 s0 {/ T/ t p
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>% E; @' y% m/ o" _* X
<?php } ?>
0 p" D& O0 {. s* ~$ f</select>: t `! d/ x+ T$ z4 g
</p>
; n1 [4 T" I- ?. h% i6 s) D9 Z; r' `
<?php
5 \% `3 Y% E& E4 X s$ M/ _break;6 L6 |2 P5 L" X$ U
case 'textarea':
( P2 [( {# z" c3 s8 u$valuex = $value['id'];
: g# m9 {& p. l/ f: d$valuey = stripslashes($valuex);
( n8 W# O) Y& c" K D8 x% U$video_code = get_settings($valuey);
+ D) ~% ?/ X1 N* W8 S4 N. O?>4 E& M0 l! h: Q* D& w
, d- w' z& y: k: X
<div class="description"><?php echo $value['name']; ?></div>
* y. ^2 g+ d5 C% S- |% c" b7 `<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
/ Y% t. o% V% p, B2 P% }9 Q! ^+ K
3 c- L j1 ]3 Q N7 E) X/ [else { echo $value['std']; } ?></textarea></p>! K- w8 \+ J* ^% C
4 Q4 p4 G' u& o5 R<?php# Q7 F' M% A1 d% K# L; h
break;
5 y/ K5 F8 z* ^* t' xcase 'close':8 }! Q5 [; A+ ]1 b( `8 X5 j0 s
?>1 }- t( e; m9 C7 z- X1 V
+ I8 Z, l2 d5 h9 N
<div class="clearfix"></div>- d9 x D# l+ w4 G5 N
</div><!-- OPTION SAVE END -->
& ~3 J8 n1 b: s; y) h, |
/ c# d5 D5 R% y1 `: H<div class="clearfix"></div>
: @* ? ^1 n; ?</div><!-- GET OPTION END -->+ _1 t n* }' A+ V' H0 V
l2 L% O3 `* K<?php
' H, O" x% }" D& h* a ybreak;0 ]& {' P h" t& l2 s0 W! s
default;
6 s7 P3 r; s. d' l2 k+ e$ b?>& m( l1 g4 j: L, y
( s# G2 ?3 w) Y# r) G
* f: k7 }( E5 K! U8 q# i<?php
% l" y& }: T) y' F- sbreak; } ?>( f* S4 F, X0 }% G6 A# q
* s, S9 t2 k# b! T! i6 G- ]! \9 M
<?php } ?>
! w$ }( p* p1 [, H- @6 }2 F# g, Q- K, Q0 q/ H5 Q3 D# Q7 ~
<p class="save-p">
. J3 R+ K& r" D# a* ?8 I7 e<input name="save" type="submit" class="sbutton" value="Save Options" />1 B q9 e+ F# J c6 U. J5 b
<input type="hidden" name="action" value="save" />
! Q8 G/ v( B( @6 M& ?</p>
3 D5 _) X/ }% F1 X: R* X% ^* C</form>
_! D2 S' V9 j' C/ l+ i9 _9 N, r9 Z/ J, Y( v- R
<form method="post">9 S* ]' X1 u/ G; h" u1 X6 |
<p class="save-p">
2 i e& J% X6 W: L* \3 p<input name="reset" type="submit" class="sbutton" value="Reset Options" />
1 a S; h5 k$ W1 ~2 M; @6 {<input type="hidden" name="action" value="reset" />
8 r! ?9 l1 x: v D( l, z+ w) U</p>5 p& X$ x1 Z1 K7 {' @; t5 P. z( a
</form>( N# M% e* ^6 r
1 C! i6 G( K' Q2 h, T
</div><!-- ADMIN OPTIONS END -->
) L: E' j* C. t, W6 U! B+ {( ]
, [8 Q8 s" n0 w9 r<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } } ~; w6 K. r8 W4 z0 _4 `
7 J/ x p& |) ^7 w$ s6 r5 V+ Zfunction mytheme_admin_register() {
) X% R- |2 u$ o2 U& cglobal $themename, $shortname, $options;
+ }! |! b% T1 g- n# |7 tif ( $_GET['page'] == basename(__FILE__) ) {2 Z1 X7 j4 [# N& |. v% m
if ( 'save' == $_REQUEST['action'] ) {0 p$ e0 ?% J4 m
foreach ($options as $value) {# q9 K& o+ a9 {, r
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }8 \2 d2 B: k% w; j4 O
foreach ($options as $value) {
% I3 J! G9 F# ?, z& I" lif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } } v k% w0 s O- S) Q' P
header("Location: themes.php?page=functions.php&saved=true");$ Y6 F3 Q2 ~4 _$ w: i% c8 u) X
die;
8 Y$ O. _) K4 w, N! A9 r8 i} else if( 'reset' == $_REQUEST['action'] ) {( k) |! l" {: [' x7 S0 M
foreach ($options as $value) {
4 X ?7 S. w+ h( e% G. e, Cdelete_option( $value['id'] ); }
* j" j, x& O7 V& u0 z9 h5 `: nheader("Location: themes.php?page=functions.php&reset=true");) d) N1 S2 b. C
die;' q8 W9 O: Q3 G. b; S
}( C# b- |) |4 g5 } L/ N
}' o3 i5 {9 E1 R8 E: o$ g
add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');) N6 [- _+ e a; {% ?" x5 w) X* u1 z
}5 j: i3 h0 C2 v+ D( f3 ]0 p/ s( B
# }- R! U6 E2 p( _6 @9 e0 V% k
function mytheme_admin_head() { ?>
: D$ c9 i/ k, j! {, t- h<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />" v" i4 D3 r* u' P$ ]1 x& B; A
<?php }
; N# C3 [5 J, s5 C |
|