|
|

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