|
|

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