|
|

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