|
|

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