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