|
|

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