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