|
|

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