|
|

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