|
|

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