|
|

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