|
|

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